Python
HackerRank: Merge the Tools! Notes Paid Members Public
Background This article was written down when I was doing a Python challenge on HackerRank: "Merge the Tools!". Merge the Tools! | HackerRankSplit a string into subsegments of length $k$, then print each subsegment with any duplicate characters stripped out.HackerRank Problem To help you understand this problem, I
HackerRank: The Minion Game Notes Paid Members Public
Background This article was written down when I was doing a Python challenge on HackerRank: The Minion Game. Hints If you haven't passed this question and want to have some hints. There are two hints I think might be helpful: * The solution can be done with one loop
HackerRank: Capitalize! Notes Paid Members Public
Background This article was written down when I was doing a Python challenge on HackerRank: Capitalize! [https://www.hackerrank.com/challenges/capitalize/problem]. It was not a hard problem, but I got the "Wrong Answer" three times... The main problem is that I am not familiar with the
HackerRank: Alphabet Rangoli Notes Paid Members Public
Background This article was written down when I was doing the Python challenge on HackerRank: Alphabet Rangoli [https://www.hackerrank.com/challenges/alphabet-rangoli/problem]. Although I passed all the tests quickly, my solution looked dirty and not clean enough. Thus I tried to simplify my solution after getting some insights
HackerRank: Designer Door Mat Notes Paid Members Public
Background I think the "Designer Door Mat [https://www.hackerrank.com/challenges/designer-door-mat/problem]" is suitable for serving as a practice f [https://www.hackerrank.com/challenges/text-alignment/problem]or your understanding of the Python center() method. Problem The problem gives you two number N and M where
Python: raw_input(), input(), strip() and split() Explanations Paid Members Public
Background This article was written down when I was doing the HackerRank Python challenge: Find a string. I think it would help explain the difference between raw_input() and input() for others. You will see raw_input() a lot in the HackerRank Editorial section since the solution was written with
Python format(): Learn the Syntax Step by Step Paid Members Public
The Chinese version of this article: Python format() 语法详解 [https://ran-blog.com/2021/09/28/python-format-%e8%af%ad%e6%b3%95%e8%af%a6%e8%a7%a3/] Basic Usage print("Hello I am {} and he is {}!".format('Tom','Jerry')) # Output:Hello I am
HackerRank: Text Alignment Notes Paid Members Public
Background This article is about a Python challenge on HackerRank: Text Alignment [https://www.hackerrank.com/challenges/text-alignment/problem]. We can definitely keep trying until we get the correct answer for this one. But I think that is kind of boring, and I really want to understand the thoughts behind