<?xml version="1.0" encoding="utf-8" standalone="yes"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom">
  <channel>
    <title>hackerrank on jonah vairon</title>
    <link>https://58e1b19d.site-bk0.pages.dev/hackerrank/</link>
    <description>Recent content in hackerrank on jonah vairon</description>
    <generator>Hugo</generator>
    <language>en-uk</language>
    <copyright>© 2025 Jonah Vairon</copyright>
    <lastBuildDate>Fri, 05 Sep 2025 00:00:00 +0100</lastBuildDate>
    <atom:link href="https://58e1b19d.site-bk0.pages.dev/hackerrank/index.xml" rel="self" type="application/rss+xml" />
    <item>
      <title>hackerrank: sherlock and the valid string</title>
      <link>https://58e1b19d.site-bk0.pages.dev/hackerrank/sherlock-and-the-valid-string/</link>
      <pubDate>Fri, 05 Sep 2025 00:00:00 +0100</pubDate>
      <guid>https://58e1b19d.site-bk0.pages.dev/hackerrank/sherlock-and-the-valid-string/</guid>
      <description>&lt;h2 id=&#34;problem&#34;&gt;problem&lt;/h2&gt;&#xA;&lt;p&gt;&lt;a href=&#34;https://www.hackerrank.com/challenges/sherlock-and-valid-string/problem&#34;&gt;Sherlock and the Valid String | HackerRank&lt;/a&gt;&lt;/p&gt;&#xA;&lt;h2 id=&#34;attempts&#34;&gt;attempts&lt;/h2&gt;&#xA;&lt;h3 id=&#34;final&#34;&gt;final&lt;/h3&gt;&#xA;&lt;p&gt;There were too many attempts for me to justify including them all. The crux here&#xA;was handling the edge cases.&lt;/p&gt;&#xA;&lt;p&gt;Because, on the surface, it seems like we can easily solve the problem with a&#xA;&lt;code&gt;collections.Counter&lt;/code&gt;. Using it, we&amp;rsquo;d get back the frequencies of each character&#xA;in the input string. So, checking the simplest case where all the characters&#xA;appear the same number of times would be as simple as checking that the size of&#xA;the set of the character frequencies is 1. All that&amp;rsquo;s then left would be to&#xA;handle the case where the set happens to have 2 frequencies; any more than that&#xA;and we know the string to be invalid.&lt;/p&gt;</description>
    </item>
  </channel>
</rss>
