Akshima Sharmakeycomputereducation.hashnode.dev·Feb 6, 2024Reverse the array - 450DSA Cracker SolutionReverse a String Given a String S , print the reverse of the string as output. class Solution { public: string revStr(string S) { for(int i = 0, j= S.length()-1; i<j ;i++,j--) { swap(S[i], S[j]); } re...Discuss·20 likes450 DSA Series450dsa
Akshima Sharmakeycomputereducation.hashnode.dev·Feb 6, 2024Find the "Kth" max and min element of an array - 450DSA Cracker SolutionKth smallest element Given an array arr[] and an integer K where K is smaller than size of array, the task is to find the Kth smallest element in the given array. It is given that all array elements are distinct. Note :- l and r denotes the starting...DiscussProgramming Blogs
Akshima Sharmakeycomputereducation.hashnode.dev·Feb 6, 2024Find the maximum and minimum element in an array - 450DSA Cracker SolutionFind minimum and maximum element in an array Given an array A of size N of integers. Your task is to find the minimum and maximum elements in the array. Example 1: Input: N = 6 A[] = {3, 2, 1, 56, 10000, 167} Output: 1 10000 Explanation: minimum and ...Discuss450 DSA Series450dsa