<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0" xmlns:atom="http://www.w3.org/2005/Atom" xmlns:dc="http://purl.org/dc/elements/1.1/">
  <channel>
    <title>DEV Community: Chinmaya Bisoi</title>
    <description>The latest articles on DEV Community by Chinmaya Bisoi (@chinmayabisoi).</description>
    <link>https://dev.to/chinmayabisoi</link>
    <image>
      <url>https://media2.dev.to/dynamic/image/width=90,height=90,fit=cover,gravity=auto,format=auto/https:%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Fuser%2Fprofile_image%2F699289%2Fdd3d07d2-c668-45ec-97c8-d8230397b9af.png</url>
      <title>DEV Community: Chinmaya Bisoi</title>
      <link>https://dev.to/chinmayabisoi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/chinmayabisoi"/>
    <language>en</language>
    <item>
      <title>Getting Started With Hackerrank Using Python | For Absolute Beginners</title>
      <dc:creator>Chinmaya Bisoi</dc:creator>
      <pubDate>Mon, 06 Sep 2021 09:09:16 +0000</pubDate>
      <link>https://dev.to/chinmayabisoi/getting-started-with-hackerrank-using-python-for-absolute-beginners-347h</link>
      <guid>https://dev.to/chinmayabisoi/getting-started-with-hackerrank-using-python-for-absolute-beginners-347h</guid>
      <description>&lt;h2&gt;
  
  
  The Intro
&lt;/h2&gt;

&lt;p&gt;Data Structures and Algorithms(DSA) are a necessity to land a Good ass Technical job. And when it comes to DSA, people turn to popular websites like &lt;code&gt;Leetcode&lt;/code&gt;, &lt;code&gt;Hackerrank&lt;/code&gt;, &lt;code&gt;Hackerearth&lt;/code&gt; and many more. &lt;/p&gt;

&lt;p&gt;That being said, Starting anew can be difficult and sometimes overwhelming and newbies can find it difficult to figure out the ins and outs of the platform they use (How to take Input(s), how to produce the proper Output(s)  &lt;/p&gt;

&lt;h2&gt;
  
  
  Hackerrank with Python
&lt;/h2&gt;

&lt;p&gt;Let's say you come across &lt;a href="https://www.hackerrank.com/challenges/list-comprehensions/problem" rel="noopener noreferrer"&gt;this&lt;/a&gt; kind of question, where you have input &lt;br&gt;
and output like:&lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8foqxdr0vsx8chqwn7w.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fi8foqxdr0vsx8chqwn7w.PNG" alt="SampleInput"&gt;&lt;/a&gt;&lt;br&gt;
Then the output would be given using &lt;code&gt;print&lt;/code&gt; and one way to take in inputs would be individually take all four inputs like x,y,z,n as given below&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if __name__ == '__main__':
    x = int(input())
    y = int(input())
    z = int(input())
    n = int(input())
    print ([[a,b,c] for a in range(0,x+1) for b in range(0,y+1) for c in range(0,z+1) if a + b + c != n ])

&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The other way to take in four inputs would be to use a for loop to store the inputs in a list.&lt;/p&gt;




&lt;p&gt;&lt;strong&gt;Let's see another&lt;/strong&gt; &lt;a href="https://www.hackerrank.com/challenges/find-second-maximum-number-in-a-list/problem" rel="noopener noreferrer"&gt;example&lt;/a&gt; &lt;br&gt;
Consider the given inputs and the following code: &lt;br&gt;
&lt;a href="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0249k2wtgbzugi95ac2.PNG" class="article-body-image-wrapper"&gt;&lt;img src="https://media.dev.to/dynamic/image/width=800%2Cheight=%2Cfit=scale-down%2Cgravity=auto%2Cformat=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fw0249k2wtgbzugi95ac2.PNG" alt="Case2SampleInput"&gt;&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;if __name__ == '__main__':
    n = int(input())
    arr = map(int, input().split())
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What the above code does is it assigns 5 to n ; then checks the second line to find &lt;code&gt;2 3 6 6 5&lt;/code&gt; where the input().split() splits the string &lt;code&gt;2 3 6 6 5&lt;/code&gt; to a list with the following items :&lt;br&gt;
&lt;code&gt;2&lt;/code&gt; &lt;code&gt;3&lt;/code&gt; &lt;code&gt;6&lt;/code&gt; &lt;code&gt;6&lt;/code&gt; &lt;code&gt;5&lt;/code&gt; &lt;/p&gt;

&lt;p&gt;The map function then converts the items to integer type and we get a list arr = [2,3,6,6,5] where each item is an integer.&lt;/p&gt;

&lt;h3&gt;
  
  
  Hope this was helpful~
&lt;/h3&gt;

&lt;h4&gt;
  
  
  Thats all for now, Until Next Time Bros
&lt;/h4&gt;

</description>
      <category>python</category>
      <category>beginners</category>
    </item>
  </channel>
</rss>
