Please turn JavaScript on
NamasteDev Blogs icon

NamasteDev Blogs

Get updates from NamasteDev Blogs via email, on your phone or read them on follow.it on your own custom news page.

You can filter the news from NamasteDev Blogs that get delivered to you using tags or topics or you can opt for all of them. Unsubscription is also very simple.

See the latest news from NamasteDev Blogs below.

Site title: NamasteDev

Is this your feed? Claim it!

Publisher:  Unclaimed!
Message frequency:  5.72 / day

Message History

Problem Statement:

Given two strings a and b, return the minimum number of times you should repeat string a so that string b is a substring of it. If it is impossible for b to be a substring of a after repeating it, return -1.

Notice: string "abc" repeated 0 times is "", repeated 1 time is "abc" and repeated 2 times...


Read full story
Problem Statement:

Given two strings a and b, return the minimum number of times you should repeat string a so that string b is a substring of it. If it is impossible for b to be a substring of a after repeating it, return -1.

Notice: string "abc" repeated 0 times is "", repeated 1 time is "abc" and repeated 2 times...


Read full story
Problem Statement:

Given a string s, rearrange the characters of s so that any two adjacent characters are not the same.

Return any possible rearrangement of s or return "" if not possible.

Examples: Example 1:

Input: s = “aab”

Output: “aba”

Example 2:

Input: s ...


Read full story
Problem Statement:

The count-and-say sequence is a sequence of digit strings defined by the recursive formula:

countAndSay(1) = "1" countAndSay(n) is the run-length encoding of countAndSay(n - 1).

Run-length encoding (RLE) is a string compression method that works by replacing consecutive identical characters (repeated 2 or more times) wit...


Read full story
Problem Statement:

Given an encoded string, return its decoded string.

The encoding rule is: k[encoded_string], where the encoded_string inside the square brackets is being repeated exactly k times. Note that k is guaranteed to be a positive integer.

You may assume that the input string is always valid; there are no extra white spaces, squa...


Read full story