Gulshan Kumarperfinsights.hashnode.dev·Apr 6, 2024Check Distances Between Same LettersYou are given a 0-indexed string s consisting of only lowercase English letters, where each letter in s appears exactly twice. You are also given a 0-indexed integer array distance of length 26. Each letter in the alphabet is numbered from 0 to 25 (i...DiscussJava Solutionarray
Gulshan Kumarperfinsights.hashnode.dev·Mar 23, 2024Decode the MessageYou are given the strings key and message, which represent a cipher key and a secret message, respectively. The steps to decode message are as follows: Use the first appearance of all 26 lowercase English letters in key as the order of the substitut...DiscussJava SolutionJava
Harshal Dongareharshaldongare.hashnode.dev·Mar 12, 2024Exploring Essential String Methods in JavaScriptIn JavaScript, strings are sequences of characters enclosed within single quotes ('') or double quotes (""). They are fundamental data types used to represent text data in various programming tasks. JavaScript provides a rich set of built-in string m...Discuss·1 likeJavaScript
Nirbhay Singhnirbhaycodes.hashnode.dev·Mar 11, 2024Popular Interview Question - Longest Palindromic SubstringLongest Palindromic Substring Problem Link: https://www.codingninjas.com/studio/problems/longest-palindromic-substring_758900?leftPanelTabValue=PROBLEM https://leetcode.com/problems/longest-palindromic-substring/ Hint: https://www.loom.com/share/...DiscussDSA prepC++
Shweta Notiyalshwetanotiyal.hashnode.dev·Mar 7, 2024All about JavaScript - StringDefinition of String "String is a sequence of characters used to form and represent a text. These can be alphabets, numbers, and special characters". In this article, you will learn about: String in JavaScript How to create a String in JavaScript ...Discuss·30 readsJavaScript
Nirbhay Singhnirbhaycodes.hashnode.dev·Mar 5, 2024Strings - Valid AnagramValid Anagram Problem Link: https://leetcode.com/problems/valid-anagram/description/ My approach: I used the concept of hashing. You can use hashmap or in this case just a simple array of size 26. Iterate through 's' string and update hash array b...DiscussDSA prepcoding
Nirbhay Singhnirbhaycodes.hashnode.dev·Mar 5, 2024Strings - Rotate StringRotate String Problem Link: https://leetcode.com/problems/rotate-string/description/ Hint: Use 'substr' method to change the string without actually modifying the string. Code: class Solution { public: bool rotateString(string s, string goal) { ...DiscussDSA prepcoding
Nirbhay Singhnirbhaycodes.hashnode.dev·Mar 5, 2024Strings - Isomorphic StringsIsomorphic Strings Problem Link: https://leetcode.com/problems/isomorphic-strings/description/ My approach: We have to do bi-directional mapping so I used two hashmaps. Code: // TIME COMPLEXITY : O(N) // SPACE COMPLEXITY : O(1) , Hashmaps will never ...DiscussDSA prepcoding
Nirbhay Singhnirbhaycodes.hashnode.dev·Mar 5, 2024Strings - Longest Common PrefixLongest Common Prefix Problem Link: https://leetcode.com/problems/longest-common-prefix/description/ My approach: I sorted the array in the ascending order of the string sizes. Then I checked every character of the arr[0] with others strings. If t...DiscussDSA prepcoding
Chris DourisProtherunner.digital·Mar 2, 2024Day 25/100 100 Days of CodeI think is much more complex than it needs to be. Am I missing something that should be quite obvious? I tried fixing it myself but I was unable to get the text from the text fields. In the end, I reverted all wide strings to standard strings. I also...Discuss100 Days of CodeC++