Posts

Showing posts from September 16, 2025

Merge Two Sorted Arrays Without Duplicates

Image
Problem of the Day: You are given two sorted arrays of integers, nums1 and nums2. Your task is to merge them into a single sorted array that contains only unique elements. Do not use any built-in sorting function. Use only one loop to traverse and merge. 1. Input: nums1 = [1, 3, 5, 7, 9] nums2 = [2, 3, 5, 6, 8, 9] Output: [1, 2, 3, 5, 6, 7, 8, 9] 2. Input: nums1 = [2, 4, 6, 8] nums2 = [1, 3, 5, 7, 9] Output: [1, 2, 3,4, 5, 6, 7, 8, 9] .snippet-thumbnail img { max-width: 50px; height: auto; object-fit: cover; }

String (11 to 20) Programs

100 Java String Programming Questions 100 Java String Programming Questions Series(11 to 20) 11. Write a program to convert string into LowerCase. Show Answer class StringToLowerCase { public static void main(String[] args) { String str = "ApplE"; char c;; System.out.println("Input given is - " + str); for (int i = 0; i = 65 && str.charAt(i) 12.Write a program to convert uppercase letters to lowercase and vice versa.. Show Answer public class ToggleCase { public static void main(String[] args) { String text = "HeLLo WoRLd JaVa123"; System.out.println("Input text is : " + text); System.out.print("Toggled: "); for (int i = 0; i = 'A' && ch = 'a' && ch 13.Write a program to remove vowels from a string. Show Answer public class RemoveVowels { public static void main...