prog.cpp:3:23: error: ‘string’ has not been declared
long long minCost(string s, vector<int>& cost) {
^~~~~~
prog.cpp:3:33: error: ‘vector’ has not been declared
long long minCost(string s, vector<int>& cost) {
^~~~~~
prog.cpp:3:39: error: expected ‘,’ or ‘...’ before ‘<’ token
long long minCost(string s, vector<int>& cost) {
^
prog.cpp: In member function ‘long long int Solution::minCost(int, int)’:
prog.cpp:4:19: error: request for member ‘size’ in ‘s’, which is of non-class type ‘int’
int n = s.size();
^~~~
prog.cpp:5:25: error: ‘LLONG_MAX’ was not declared in this scope
long long ans = LLONG_MAX; // Initialize to maximum value
^~~~~~~~~
prog.cpp:5:25: note: ‘LLONG_MAX’ is defined in header ‘<climits>’; did you forget to ‘#include <climits>’?
prog.cpp:1:1:
+#include <climits>
class Solution {
prog.cpp:5:25:
long long ans = LLONG_MAX; // Initialize to maximum value
^~~~~~~~~
prog.cpp:14:24: error: invalid types ‘int[int]’ for array subscript
if (s[i] == ch) {
^
prog.cpp:19:28: error: ‘cost’ was not declared in this scope
sum += cost[i];
^~~~
prog.cpp:25:23: error: ‘min’ was not declared in this scope
ans = min(ans, sum);
^~~