String Reverse in Java: Single Line SolutionProgram to Reverse a String Input: str="Navnath" Original String is: "Navnath" Output: revstr="htanvaN" Reverse String is: "htanvaN" Solution: Language Used: Java Approach 1: String Concatination import java.util.Scanner; public class reverse_stri...Mar 25, 2023·1 min read
Java Date and TimeThe Calendar class is an abstract class that provides methods for converting between a specific instant in time and a set of calendar fields such as YEAR, MONTH, DAY_OF_MONTH, HOUR, and so on, and for manipulating the calendar fields, such as getting...Jan 26, 2023·2 min read
Toggle String in JavaProblem You have been given a String S consisting of uppercase and lowercase English alphabets. You need to change the case of each alphabet in this String. That is, all the uppercase letters should be converted to lowercase and all the lowercase let...Jan 17, 2023·1 min read
Find All Anagrams in a StringGiven two strings s and p, return an array of all the start indices of p's anagrams in s. You may return the answer in any order*.* An Anagram is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all th...Jan 12, 2023·2 min read
Java Anagram: HackerRank Problem Solution in JavaAnagram: The dictionary meaning of the word anagram is a word or phrase formed by rearranging the letters. Two strings are said to be anagrams if they make a meaningful word by rearranging or shuffling the letters of the string. In other words, we ca...Jan 7, 2023·3 min read
Java Substring: HackerRank Solution in JavaGiven a string,s, and two indices,start and end, print a substring consisting of all characters in the inclusive range from start to end - 1. You'll find the String class' substring method helpful in completing this challenge. Input Format The first ...Jan 6, 2023·2 min read
Java Datatypes: HackerRank Solution in JavaJava has 8 primitive data types; char, boolean, byte, short, int, long, float, and double. For this exercise, we'll work with the primitives used to hold integer values (byte, short, int, and long): A byte is an 8-bit signed integer. A short is a 1...Jan 5, 2023·2 min read