Skip to content

Tag Archives: strings

Given a string, str, the task is to find the indices of the given string such that the count of lexicographically smaller characters on the… Read More
Given a binary array, in which, moving an element from index i to index j requires abs(i – j) cost. The task is to find… Read More
Given string str of length N, the task is to check if the given string contains only special characters or not. If the string contains… Read More
Given two strings str1 and str2, each of length N and consisting of lowercase English alphabets only, the task is to check if string str1… Read More
Given a number num and String str, the task is to generate the new String by extracting the character from the string by using the… Read More
Given a string S of length N consisting of lowercase alphabets, the task is to find the minimum number of operations to convert the given… Read More
Given two strings S1 of size N and S2 of size M, the task is to find the lexicographically smallest and the largest anagrams of… Read More
Given string str of lowercase alphabets and an array cost[], where cost[i] represents the cost of deletion of ith character in the given string. The… Read More
Given an array of strings arr[] where each string is of the form “name:number” and a character T as input, the task is to generate… Read More
Given a string str and a positive integer k, the task is to write a Java program to print the first k characters of the… Read More
Given string str, the task is to print the middle character of a string. If the length of the string is even, then there would… Read More
Given string str, the task is to write a Java program to swap the first and the last character of the given string and print… Read More
Given string str, the task is to write Java Program to remove the first and the last character of the string and print the modified… Read More
Given a string in Snake Case, the task is to write a Java program to convert the given string from snake case to camel case… Read More
Given a date in the form of a string, the task is to write a Java Program to get the day, month, and year from… Read More