Akshima Sharmakeycomputereducation.hashnode.dev·Jan 17, 2024Array Questions(Program)Find 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. pair<long long, long long> getMinMax(long long arr[], int n) { pair <long, long> p1; p1.f...DiscussBasic Array Programs Solutions - Source Geeksforgeeks (using CPP)C++

Akshima Sharmakeycomputereducation.hashnode.dev·Jan 16, 2024Array Questions(Program)Basic Level Questions Binary Search Given a sorted array of size N and an integer K, find the position(0-based indexing) at which K is present in the array using binary search. Input: N = 5 arr[] = {1 2 3 4 5} K = 4 Output: 3 Explanation: 4 appears ...DiscussBasic Array Programs Solutions - Source Geeksforgeeks (using CPP)array

Priyojit Singhanerdbash.hashnode.dev·Dec 30, 2023Kth smallest element - GeeksforGeeksThe problem says that you are given an array of n size. The array is not sorted and your task is to find the kth smallest element in the array. So you could have technically returned the element at arr[k-1] if the array was sorted, which means techn...Discuss·1 likeAlgorithmsJava

Sirisha Challagirisirishachallagiri.hashnode.dev·Dec 8, 2023Transform to PrimeGiven an array of n integers. Find the minimum positive number to be inserted in array, so that sum of all elements of array becomes prime. Example 1: Input: N=5 arr = {2, 4, 6, 8, 12} Output: 5 Explanation: The sum of the array is 32 ,we can add ...DiscussCode With Sirigeeksforgeeks

Gulshan Kumarperfinsights.hashnode.dev·Dec 8, 2023Find Frequency of an Integer in a Vector (N Positive Integers & X)Q - Given a vector of N positive integers and an integer X. The task is to find the frequency of X in the vector. GeekForGeeks Problem - Link | Click Here class Solution { // Function to find the frequency of element 'x' in array 'A' int find...DiscussJava SolutionJava

Sirisha Challagirisirishachallagiri.hashnode.dev·Dec 7, 2023Amazon - How Many X’s In a RangeGiven two integers L, R, and digit X. Find the number of occurrences of X in all the numbers in the range (L, R) excluding L and R. Example 1: Input: L=10, R=19, X=1 Output: 9 Explanation: There are 9 1s (11, 12, 13, 14, 15, 16, 17, 18) in the number...Discuss·3 likesCode With Sirigeeksforgeeks

Gulshan Kumarperfinsights.hashnode.dev·Dec 1, 2023Efficiently Separate Positive and Negative Numbers in an Array (Preserves Order)Q - Given an unsorted array arr[] of size N having both negative and positive integers. The task is to place all negative elements at the end of the array without changing the order of positive elements and negative elements. GeeksForGeeks Question -...DiscussJava SolutionJava

Gulshan Kumarperfinsights.hashnode.dev·Nov 23, 2023Reverse the stringQ - You are given a string s. You need to reverse the string. GeekForGeeks Problem - Link | Click Here class Reverse { // Method to reverse a given string public static String reverseWord(String str) { // Get the length of the input s...DiscussJava SolutionJava

Gulshan Kumarperfinsights.hashnode.dev·Nov 21, 2023Find the minimum and maximum elements in the array.Given an array A of size N of integers. Your task is to find the minimum and maximum elements in the array. GeekForGeek Problem - Link | Click Here class Compute { static Pair getMinMax(long a[], long n) { // Handle empty array cas...Discuss·5 likesJava Solutionarray

John Literjliter.hashnode.dev·Nov 8, 2023HTML Basics: Your Gateway to Web DevelopmentIn the digital age, having a basic understanding of HTML (Hypertext Markup Language) is becoming increasingly essential. HTML serves as the backbone of every website on the internet, enabling browsers to interpret and display content. Whether you're ...DiscussHTML5