Sirisha Challagirisirishachallagiri.hashnode.dev·20 hours ago1704. Determine if String Halves Are AlikeYou are given a string s of even length. Split this string into two halves of equal lengths, and let a be the first half and b be the second half. Two strings are alike if they have the same number of vowels ('a', 'e', 'i', 'o', 'u', 'A', 'E', 'I', '...Discuss·2 likesCode With Sirileetcode
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 26, 20232000. Reverse Prefix of WordProblem Link: https://leetcode.com/problems/reverse-prefix-of-word/description/ Given a 0-indexed string word and a character ch, reverse the segment of word that starts at index 0 and ends at the index of the first occurrence of ch (inclusive). If t...Discuss·2 likesCode With Sirileetcode
Sudarshan Doiphodesudarshandoiphode.hashnode.dev·Nov 24, 2023"isBlank() vs. isEmpty() – Which One Should You Choose?"Introduction If you are a Java developer, then definitely you have used String class and its methods in your career. But some of you might have also used one of the isBlank or isEmpty methods and some of you always get confused about choosing one of ...Discuss·70 readsString class in java
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
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 17, 2023Longest Common PrefixThe longest common prefix is a problem in that we can find the prefix in every string of the array. str = [ "flower", "flow", "fight" ] output: fl (every string in the array contains the "fl" as its prefix. public class LogestCommonPrefix { public ...DiscussCode With SiriJava
Sawan Badhwarsawan1367.hashnode.dev·Nov 14, 2023Day 15 of DSA ChallengeRise and Shine. One more day playing with recursion. I tried solving two new problems that I found out. However, I wasn't able to solve the second one. But still, I got this one down. In this case, I was asked to remove the middle element of the stac...DiscussStacks
Gulshan Kumarperfinsights.hashnode.dev·Nov 11, 2023Java program: Get character before indexWrite a Java program to get the character (Unicode code point) before the specified index within the string. public class demo { public static void main(String[] args) { String str = "GulshanKumar"; int givenIndex = 4; i...DiscussJava SolutionJava
Gulshan Kumarperfinsights.hashnode.dev·Nov 11, 2023Find upper and lower case from string.Write a Java program to find the upper and lower case from string and print count. import java.util.*; import static java.lang.System.in; public class demo { public static void main(String[] args) { String str = "Gulshan Kumar"; ...DiscussJava SolutionJava
ROSHAN CSE0026roshanjha23.hashnode.dev·Nov 11, 2023Understanding Rabin-Karp Algorithm for String MatchingString matching is a fundamental problem in computer science and has applications ranging from text processing to bioinformatics. The Rabin-Karp algorithm is one such approach to efficiently find a pattern within a larger text. This algorithm combine...Discusscoding
Sirisha Challagirisirishachallagiri.hashnode.dev·Nov 10, 2023Reverse of a stringMethod 1: public class StringReverse { public static void main(String[] args) { String s = "code with siri"; String str=""; System.out.println("Original"+s); for(int i=s.length()-1;i>=0;i--){ str = str+s.charAt(i); } S...Discuss·1 likeCode With SiriJava