๐—–๐—ฆ ๐—”๐—น๐—ด๐—ผ ๐Ÿ’ป ๐ŸŒ ใ€Ž๐—–๐—ผ๐—บ๐—ฝ๐—ฒ๐˜๐—ถ๐˜๐—ถ๐˜ƒ๐—ฒ ๐—ฃ๐—ฟ๐—ผ๐—ด๐—ฟ๐—ฎ๐—บ๐—บ๐—ถ๐—ป๐—ดใ€
9.58K subscribers
5.59K photos
3 videos
95 files
10K links
๐ŸšฉMain Group - @SuperExams
๐Ÿ“Job Updates - @FresherEarth

๐Ÿ”ฐAuthentic Coding Solutions(with Outputs)
โš ๏ธDaily Job Updates
โš ๏ธHackathon Updates & Solutions

Buy ads: https://telega.io/c/cs_algo
Download Telegram
#include <bits/stdc++.h>
using namespace std;

int main ()
{
int n;
cin >> n;
vector<int64_t> min_cost(n+2, 0x3f3f3f3f3f3f3f3f);
min_cost[0] = 0;
vector<int> range(n+2), cost(n+2);
for (int i = 1; i <= n+1; i++) {
cin >> range[i];
}
for (int i = 1; i <= n+1; i++) {
cin >> cost[i];
}
for (int i = 1; i <= n+1; i++) {
if (range[i] == 0) continue;

int nxt = min(i + range[i], n+1);
int prev = max(i - range[i] - 1, 0);
int64_t cprev = cost[prev];
for (int j = prev+1; j <= nxt; j++) {
min_cost[j] = min(min_cost[j], min_cost[prev] + cost[i]);
}
}
cout << ((min_cost[n+1] < 0x3f3f3f3f3f3f3f3f) ? min_cost[n+1]: -1) << "\n";
}

Garden
Intuit โœ…
๐Ÿ‘1
public static int find(int[] arr) {
// Sort the array in ascending order
Arrays.sort(arr);
HashSet<Double> hm=new HashSet<>();

int n = arr.length;
int count = 0;
int left = 0;
int right = n - 1;

while (left < right) {

double avgMaxMin = (arr[left] + arr[right]) / 2.0;

hm.add(avgMaxMin);

left++;
right--;
}

return hm.size();
}

Amazon OAโœ…
    public static String lexicographicallyMaxString(String inputStr) {
        char[] chars = inputStr.toCharArray();
        int n = chars.length;
        HashSet<Character> c=new HashSet<>();

    
        Map<Character, Integer> charCount = new HashMap<>();
        for (char ch : chars) {
            charCount.put(ch, charCount.getOrDefault(ch, 0) + 1);
        }

      
        PriorityQueue<Character> pq = new PriorityQueue<>((a, b) -> a-b);
        for (char ch : charCount.keySet()) {
            pq.add(ch);
            c.add(ch);
        }

      
        StringBuilder sb = new StringBuilder();
        while (!pq.isEmpty()) {
            char currentChar = pq.poll();
            if(c.contains(currentChar)){
            sb.append(currentChar);
            c.remove(currentChar);
            }
        }

        return sb.toString();
    }


Modify the string โœ…
Cisco Interview Experience :

1)First introduction
2)Then she asked about course like i have done cisco ccna course that
3)Then about web dev internship
4)College Project Explain
5)About python
6)Why python
7)She gave a task like CAT BAT PAT DAT
output should be like

["CA", "BA", "PA", "DA"]
8)Then 2 questions about dependency
9)Global and local variables
10)The she gave me 2 strings and asked me how to print them in one line
11)Without using concat
12)OOPS
13)Different between python and java
14)Reverse of a number
15)Swapping
16)Why reactjs
17)API
18)Backend coding
19)If u are from ECE then they will ask logic of code
Any Questions
๐Ÿ‘2