3 views
25 Jan 2026
Write a gcd(a,b) function and print gcd for the given inputs....
3 views
25 Jan 2026
Create a function isPalindrome(s) that ignores spaces and case. Print YES or NO....
6 views
25 Jan 2026
Write a function that counts vowels in a string (a,e,i,o,u)....
4 views
25 Jan 2026
Write area(w,h) and print the rectangle area....
4 views
25 Jan 2026
Write a function reverseStr(s) and print the reversed string....
4 views
25 Jan 2026
Compute n! using recursion (n...
4 views
25 Jan 2026
Compute fib(n) with memoization (fib(0)=0, fib(1)=1)....
3 views
25 Jan 2026
Sort n strings by length, and for equal length sort lexicographically....
4 views
25 Jan 2026
Given x, apply f(x)=2x+1 two times and print the result....
3 views
25 Jan 2026
Given n numbers, use a function to square each and print the squared list....
4 views
25 Jan 2026
Write a function balanced(s) for () only. Print YES or NO....
4 views
25 Jan 2026
Given two sorted arrays, merge them using a function and print the merged list....
4 views
25 Jan 2026
Given a sorted array and q queries, use a function to binary search each query. Print 0-based index or -1....
4 views
25 Jan 2026
Given a postfix expression with integers and ops + - * /, evaluate it using helper functions....
5 views
25 Jan 2026
Create a counter() closure that returns 1,2,3,... each time it is called. Input q, print q lines of counts....
3 views
25 Jan 2026
Input x. Define f(x)=x+3 and g(x)=x*2. Compute g(f(x)) and f(g(x)) and print both....
4 views
25 Jan 2026
Given n and a list of swaps (i j), start with [1..n]. Apply swaps and print the final array....
5 views
25 Jan 2026
Given n words, group them by first letter (a-z) and print counts per letter present in sorted order....
5 views
25 Jan 2026
Given n numbers and k, print the k most frequent numbers. If frequencies tie, smaller number first....
7 views
25 Jan 2026
Given n intervals, merge overlaps and print the merged intervals sorted by start....