<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[Stories by Yogesh S P on Medium]]></title>
        <description><![CDATA[Stories by Yogesh S P on Medium]]></description>
        <link>https://medium.com/@YogeshSP?source=rss-667175c2430f------2</link>
        <image>
            <url>https://cdn-images-1.medium.com/fit/c/150/150/1*PBYaDE7cTcPD2nBF_I7Feg.jpeg</url>
            <title>Stories by Yogesh S P on Medium</title>
            <link>https://medium.com/@YogeshSP?source=rss-667175c2430f------2</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Thu, 03 Dec 2026 12:11:08 GMT</lastBuildDate>
        <atom:link href="https://medium.com/@YogeshSP/feed" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[New Era — Podcast]]></title>
            <link>https://medium.com/@YogeshSP/new-era-podcast-a39d30fde88c?source=rss-667175c2430f------2</link>
            <guid isPermaLink="false">https://medium.com/p/a39d30fde88c</guid>
            <category><![CDATA[podcast]]></category>
            <category><![CDATA[startup]]></category>
            <category><![CDATA[saas]]></category>
            <dc:creator><![CDATA[Yogesh S P]]></dc:creator>
            <pubDate>Sun, 12 Jul 2020 13:57:26 GMT</pubDate>
            <atom:updated>2020-07-12T13:57:26.625Z</atom:updated>
            <content:encoded><![CDATA[<h3>New Era — Podcast</h3><p>Nowadays on my morning walk, I started spending quality time on Podcasts. I am the kind of person curious on Startups, Tech Companies and Products. Hearing Podcasts gives a great recreation as well as knowledge.</p><p>The people whom you admire on the Indian Startup world directly come to your ears and share their exciting journeys as well as learnings in a way that could help you learn and grow.</p><p>I like to recommend a few podcasts that I feel really useful.</p><ol><li><strong>Outliers — Factordaily </strong>(<a href="https://open.spotify.com/show/60p3d3mYOEWDVLSfLzRCiU">https://open.spotify.com/show/60p3d3mYOEWDVLSfLzRCiU</a>)</li></ol><p>The podcast is moderated by <a href="https://twitter.com/pankajontech">Pankaj Mishra</a> co-founder of <a href="https://factordaily.com/">Factordaily</a>. The podcast has more than 100 episodes. The speakers are people who made stuff in their life. Pankaj is very particular in picking people for the podcast.</p><p>My favourite episodes on this series feature Sridhar Vembu, Girish Mathrubootham, Rajendran Dandapani, Rajiv Chilka (Creator of Chotta Beam), Founder of BookMyShow, Jyoti Bansal and more.</p><p>Pankaj puts a lot of time, effort and dedication on doing this. I was fortunate enough to meet him during a meetup at Bangalore.</p><p><strong>2. SaaSBOOMi </strong>(<a href="https://open.spotify.com/show/66cCCDexPv4FKDB3CKdCDa">https://open.spotify.com/show/66cCCDexPv4FKDB3CKdCDa</a>)</p><p>SaasBOOMi is a voluntary community of SAAS company founders based out of Chennai. It is also moderated by Pankaj Mishra of Factordaily.</p><p>My favourite episode on the series is by Suresh Sambantham, CEO, KissFlow.</p><p>3.<strong> Use Case</strong></p><p>Use Case is one of my favourite series moderated by <a href="https://www.linkedin.com/in/jayadevanpk?originalSubdomain=in">Jayadevan</a> and <a href="https://www.linkedin.com/in/ravish--bhatia?originalSubdomain=in">Ravish Bhatia</a>.</p><p>The podcast is focused on Product Management. The series features product people from Google, TikTok, Nir Eyal (Author of Hooked) and more.</p><p>(<a href="https://open.spotify.com/show/4GaRbNnEPk4rPvGDOa2k9J">https://open.spotify.com/show/4GaRbNnEPk4rPvGDOa2k9J</a>)</p><p><strong>4.The Startup Operator</strong></p><p>I came to know about this podcast through Spotify Recommendation. It features <a href="https://www.linkedin.com/in/jayadevanpk?originalSubdomain=in">Jayadevan</a> of Freshworks, Former Capillary Tech Sales head and more.</p><p>(<a href="https://open.spotify.com/show/1kRdGSsgqVpKmQJ4PWXhh3">https://open.spotify.com/show/1kRdGSsgqVpKmQJ4PWXhh3</a>)</p><p><strong>5.Insights Podcast Series</strong></p><p>I haven’t heard much on series but still, the episodes I heard are super awesome. The podcast is by Accel a veteran venture capitalist firm. The episodes I enjoyed hearing are Kunal Shah of Cred and Swiggy CEO.</p><p>(<a href="https://open.spotify.com/show/1VqX3K55LjN4BjqKy4vvWl">https://open.spotify.com/show/1VqX3K55LjN4BjqKy4vvWl</a>)</p><p>In addition, I recommend Spotify to hear podcasts because their recommendation is really sharp and helps in discovering new podcasts.</p><p>On the next blog, I will write about the podcasts that I enjoyed listening</p><p>Do share your thoughts and podcast recommendation on the comments below.</p><p>Stay Safe!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=a39d30fde88c" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Vita Questions and Solutions #2]]></title>
            <link>https://medium.com/guvi/code-vita-questions-and-solutions-2-ebe8e498df41?source=rss-667175c2430f------2</link>
            <guid isPermaLink="false">https://medium.com/p/ebe8e498df41</guid>
            <category><![CDATA[tcsinterviewready]]></category>
            <category><![CDATA[codevita]]></category>
            <category><![CDATA[guvi]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yogesh S P]]></dc:creator>
            <pubDate>Fri, 28 Jun 2019 05:36:42 GMT</pubDate>
            <atom:updated>2019-06-28T05:36:42.850Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Problem A: Pascal Pyramid</em></strong></p><p>Pascal’s triangle giving binomial coefficients is well known. In this triangle, elements in each row can be obtained by adding two adjacent elements in the previous row. The pyramid of numbers we construct in this problem is similar to the Pascal triangle. We start with six numbers at the base of the pyramid and construct the pyramid one layer at a time by adding the two adjacent numbers in the previous layer. For Example, starting with the numbers 1 2 3 4 5 6 in the base, we get the following pyramid. The apex of the pyramid is filled with the product of the numbers in the row below instead of the sum. In the above pyramid, the apex is filled with the number 48 x 64 =3072. The aim is to get the largest number possible at the apex of the pyramid. The input will be a set of N positive integers. Six need to be chosen from these and arranged at the base to get the largest possible number at the top.</p><p>Input Format: The first line of the input is N, the total number of integers that will be given. The second line is a set of N (not necessarily distinct) comma separated positive integers from which the six numbers at the base need to be selected.</p><p>Output Format: The output is one line with an integer representing the maximum value of the apex of the pyramid when six integers are selected and arranged suitably at the base.</p><p><strong><em>Constraints:</em></strong> N &lt; 13 Integers provided for selection ≤ 100<br><strong> <em>Example 1:</em></strong></p><p><strong><em>Input</em></strong><br> 8 <br>10,4,74,61,8,37,2,35</p><p><strong><em>Output </em></strong><br>746415</p><p>Explanation There are 8 numbers given, from which the 6 numbers in the base are to be selected and arranged so as to maximize the apex number. One way of doing this is in the figure below.</p><p><strong><em>Solution in C++:</em></strong></p><pre>#include &lt;bits/stdc++.h&gt;<br>#define ll long long int<br>using namespace std;<br>ll N,x,idx;<br>vector &lt;ll&gt; v,v1,v2,v3;<br>ll f1,f2,f3,f4,f5,f6,ans;<br>int main()<br>{<br> cin&gt;&gt;N;<br> for(int i=0;i&lt;N;i++){<br> cin&gt;&gt;x;<br> v.push_back(x);<br> <br> sort(v.begin(),v.end());<br> idx=v.size()-1;<br> v1.push_back(v[idx]); idx — ;<br> v1.push_back(v[idx]); idx — ;<br> v2.push_back(v[idx]); idx — ;<br> v2.push_back(v[idx]); idx — ;<br> v3.push_back(v[idx]); idx — ;<br> v3.push_back(v[idx]); <br> for(int i=0;i&lt;2;i++){<br> f3=v1[i];<br> f4=v1[(!i)];<br> for(int j=0;j&lt;2;j++){<br> f2=v2[j];<br> f5=v2[(!j)];<br> for(int k=0;k&lt;2;k++){<br> f1=v3[k];<br> f6=v3[(!k)];<br> ans=max(ans,(f1+4*f2+6*f3+4*f4+f5)*(f2+4*f3+6*f4+4*f5+f6));<br> <br> <br> <br> cout&lt;&lt;ans&lt;&lt;endl;<br> return 0;<br>}</pre><p><strong><em>Problem B: Bride Hunting</em></strong></p><p>Sam is an eligible bachelor. He decides to settle down in life and start a family. He goes bride hunting.<br>He wants to marry a girl who has at least one of the 8 qualities mentioned below:-<br>1) The girl should be rich.<br>2) The girl should be an Engineer/Doctor.<br>3) The girl should be beautiful.<br>4) The girl should be of height 5.3&quot;.<br>5) The girl should be working in an MNC.<br>6) The girl should be an extrovert.<br>7) The girl should not have spectacles.<br>8) The girl should be kind and honest.<br>He is in search of a bride who has some or all of the 8 qualities mentioned above. On bride hunting, he may find more than one contenders to be his wife.<br>In that case, he wants to choose a girl whose house is closest to his house. Find a bride for Sam who has maximum qualities. If in case, there are more than one contenders who are at equal distance from Sam’’s house; then<br>print ““Polygamy not allowed””.<br>In case there is no suitable girl who fits the criteria then print “”No suitable girl found””<br>Given a Matrix N*M, Sam’s house is at (1, 1). It is denoted by 1. In the same matrix, the location of a marriageable Girl is also denoted by 1. Hence 1 at location (1, 1) should not be considered as the location of a marriageable Girl’s location.<br>The qualities of that girl, as per Sam’’s criteria, have to be decoded from the number of non-zero neighbors (max 8-way) she has. Similar to the condition above, 1 at location (1, 1) should not be considered as the quality of a Girl. See Example section to get a better understanding.</p><p>Find Sam, a suitable Bride and print the row and column of the bride, and find out the number of qualities that the Bride possesses.</p><p>NOTE: — Distance is calculated in number of hops in any direction i.e. (Left, Right, Up, Down and Diagonal)</p><p><strong><em>Constraints</em></strong><br>2 &lt;= N,M &lt;= 10²</p><p><strong><em>Input Format</em></strong><br>First Line contains the row (N) and column (M) of the houses.<br>Next N lines contain the data about girls and their qualities.</p><p><strong><em>Output</em></strong><br>It will contain the row and column of the bride, and the number of qualities that Bride possess separated by a colon (i.e. :)</p><p><strong><em>Explanation</em></strong><br><strong><em>Example 1</em></strong><br><em>Input:</em><br>2 9<br>1 0 1 1 0 1 1 1 1<br>0 0 0 1 0 1 0 0 1<br><strong><em>Output:</em></strong><br>1:7:3</p><p><strong><em>Explanation:</em></strong><br>The girl and qualities are present at (1,3),(1,4),(1,6),(1,7),(1,8),(1,9),(2,4),(2,6),(2,9).<br>The girl present at (1,3) has 2 qualities (i.e. (1,4)and (2,4)).<br>The girl present at (1,4) has 2 qualities.<br>The Bride present at (1,6) has 2 qualities.<br>The Bride present at (1,7) has 3 qualities.<br>The Bride present at (1,8) has 3 qualities.<br>The Bride present at (1,9) has 2 qualities.<br>The Bride present at (2,4) has 2 qualities.<br>The Bride present at (2,6) has 2 qualities.<br>The Bride present at (2,9) has 2 qualities.<br>As we see, there are two contenders who have maximum qualities, one is at (1,7) and another at (1,8).<br>The girl who is closest to Sam’s house is at (1,7). Hence, she is the bride.<br>Hence, the output will be 1:7:3.<br><strong><em>Example 2</em></strong><br><strong><em>Input:</em></strong><br>6 6<br>1 0 0 0 0 0<br>0 0 0 0 0 0<br>0 0 1 1 1 0<br>0 0 1 1 1 0<br>0 0 1 1 1 0<br>0 0 0 0 0 0<br><strong><em>Output:</em></strong></p><p>4:4:8</p><p><strong>Explanation</strong>:</p><p>The bride and qualities are present at (3,3),(3,4),(3,5),(4,3),(4,4),(4,5),(5,3),(5,4),(5,5)</p><p>The Bride present at (3,3) has 3 qualities (i.e. (3,4),(4,3) and (4,4)).</p><p>The Bride present at (3,4) has 5 qualities.</p><p>The Bride present at (3,5) has 3 qualities.</p><p>The Bride present at (4,3) has 5 qualities.</p><p>The Bride present at (4,4) has 8 qualities.</p><p>The Bride present at (4,5) has 5 qualities.</p><p>The Bride present at (5,3) has 3 qualities.</p><p>The Bride present at (5,4) has 5 qualities.</p><p>The Bride present at (5,5) has 3 qualities.</p><p>As we see, the girl present in (4,4) has maximum number of Qualities. Hence, she is the bride.</p><p>Hence, the output will be 4:4:8.</p><p><strong><em>Solution in C++:</em></strong></p><pre>#include &lt;bits/stdc++.h&gt;<br>#define ll long long int<br>using namespace std;<br>ll N,M;<br>ll mat[1000][1000];<br>ll x_dist,y_dist,t_dist;<br>ll prop_ans=-1e9,prod_dist=1e9,x_ans,y_ans;<br>ll f1(ll x, ll y){<br> if(x&lt;1||x&gt;N||y&lt;1||y&gt;M||mat[x][y]==0) return 0;<br> return 1;<br>}<br>ll f2(ll x , ll y){<br> if(mat[x][y]==0) return 0;<br> return f1(x-1,y)+f1(x+1,y)+f1(x,y-1)+f1(x,y+1)+f1(x-1,y-1)+f1(x-1,y+1)+f1(x+1,y-1)+f1(x+1,y+1);<br>}<br>ll f(pair&lt;ll,pair&lt;ll,ll&gt;&gt; a, pair&lt;ll,pair&lt;ll,ll&gt;&gt; b){<br> if(a.first!=b.first) return a.first&gt;b.first;<br> else max(a.second.first,a.second.second)&lt;max(b.second.first,b.second.second);<br>}<br>int main()<br>{<br> cin&gt;&gt;N&gt;&gt;M;<br> for(int i=1;i&lt;=N;i++){<br> for(int j=1;j&lt;=M;j++){<br> cin&gt;&gt;mat[i][j];<br> <br> <br> for(int i=1;i&lt;=N;i++){<br> for(int j=1;j&lt;=M;j++){<br> mat[i][j]=f2(i,j);<br> <br> <br> for(int i=1;i&lt;=N;i++){<br> for(int j=1;j&lt;=M;j++){<br> if(i==1&amp;&amp;j==1){<br> //do nothing<br> <br> else{<br> if(prop_ans&lt;mat[i][j]){<br> prop_ans=mat[i][j];<br> prod_dist=max(i-1,j-1);<br> x_ans=i;<br> y_ans=j;<br> <br> else if(prop_ans==mat[i][j]){<br> ll temp=max(i-1,j-1);<br> if(prod_dist&gt;temp){<br> prod_dist=temp;<br> x_ans=i;<br> y_ans=j;<br><br> cout&lt;&lt;x_ans&lt;&lt;”:”&lt;&lt;y_ans&lt;&lt;”:”&lt;&lt;prop_ans&lt;&lt;endl;<br> return 0;<br>}</pre><p><strong>Problem C: Super ASCII String Checker</strong></p><p>In the Byteland country a string “S” is said to super ascii string if and only if count of each character in the string is equal to its ascii value.</p><p>In the Byteland country ascii code of ‘a’ is 1, ‘b’ is 2 …’z’ is 26.</p><p>Your task is to find out whether the given string is a super ascii string or not.</p><p><strong><em>Input Format:</em></strong></p><p>First line contains number of test cases T, followed by T lines, each containing a string “S”.</p><p><strong><em>Output Format:</em></strong><br>For each test case print “Yes” if the String “S” is super ascii, else print “No”<br><strong><em>Constraints:</em></strong><br>1&lt;=T&lt;=100<br>1&lt;=|S|&lt;=400, S will contains only lower case alphabets (‘a’-’z’).</p><p><strong><em>Sample Input and Output</em></strong></p><p><strong><em>Input</em></strong><br><br>2<br>bba<br>scca</p><p><strong><em>Output</em></strong></p><p>Yes<br>No</p><p><strong><em>Explanation:</em></strong></p><p>In case 1, viz. String “bba” -<br>The count of character ‘b’ is 2. Ascii value of ‘b’ is also 2.<br>The count of character ‘a’ is 1. Ascii value of ‘a’ is also 1.<br>Hence string “bba” is super ascii.</p><p><strong><em>Solution in C++:</em></strong></p><pre>#include &lt;bits/stdc++.h&gt;<br>#define ll long long int<br>using namespace std;<br>ll N,status;<br>string s;<br>map&lt;char,ll&gt;m;<br>int main()<br>{<br> cin&gt;&gt;N;<br> while(N — ){<br> cin&gt;&gt;s;<br> m.clear();<br> for(int i=0;s[i];i++){<br> m[s[i]]++;<br> <br> status=1;<br> for(auto i:m){<br> if(int(i.first-’a’)+1!=i.second) status=0;<br> <br> if(status) cout&lt;&lt;”Yes”&lt;&lt;endl;<br> else cout&lt;&lt;”No”&lt;&lt;endl;<br> <br> return 0;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=ebe8e498df41" width="1" height="1" alt=""><hr><p><a href="https://medium.com/guvi/code-vita-questions-and-solutions-2-ebe8e498df41">Code Vita Questions and Solutions #2</a> was originally published in <a href="https://medium.com/guvi">Guvi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Code Vita Questions and Solutions #1]]></title>
            <link>https://medium.com/guvi/code-vita-questions-and-solutions-1-2f586ae8bf1d?source=rss-667175c2430f------2</link>
            <guid isPermaLink="false">https://medium.com/p/2f586ae8bf1d</guid>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Yogesh S P]]></dc:creator>
            <pubDate>Fri, 28 Jun 2019 04:49:21 GMT</pubDate>
            <atom:updated>2019-06-28T05:03:46.619Z</atom:updated>
            <content:encoded><![CDATA[<p><strong><em>Problem A</em></strong></p><p><em>GREEDY HOSTEL OWNER</em></p><p>You know that summers are at peak this year and every day is hot and due to this everyone is using coolers and ACs and a lot of electricity is consumed by the people. You are living in a hostel and your hostel owner decided to charge extra for electricity consumption. To achieve this he put one separate electricity meter for every room and connected all those meters to central meter. But the hostel owner is a bit greedy and wants to manipulate the meters to show a reading that is more than the actual consumption of electricity. He also encrypted all the meters with alphabets. The technique he used for encrypting is as follows: Every meter has 6 Alphabets i.e. 6 digits. Every alphabet is in upper case. Allowed alphabets are A, B, C, D, E, F, G, H, I, J. A corresponds to 0, B = 1 and similarly C = 2, D = 3, E = 4, F = 5, G = 6, H = 7, I = 8, J = 9 The interpretation rules change as follows: If the alphabet next to J is A, then J represents 0. Similarly, if the alphabet after I is B, then I counts as 1 (and not 8), the alphabet after H is C, then H represents 2. The same is true if D follows G and if E follows F. Note that A, B, C, D and E will always retain their respective values. When J is not followed by A, J will represent 9 and similar rules for I, H, G and F You are given central meter reading and encrypted readings of all the meters in the hostel. Your task is to find out whether the owner is Greedy or Innocent. If he is greedy then print the unit difference otherwise print innocent. Owner is greedy if and only if (units of all meters in the hostel except central meter &lt; central meter units)</p><p><strong><em>Input Format: </em></strong><br>First line contains an integer N, giving the number of rooms in the hostel. The next line contains N strings each of length 6 characters giving the readings of the meters in the rooms The next line contains an integer that gives the reading in the central meter.</p><p><strong><em>Output Format: </em></strong><br>First line containing either GREEDY or INNOCENT If the first line is GREEDY, the next line should contain the difference (as a decimal number) between the central meter reading and the consumption shown in the rooms.</p><p><strong><em>Constraints: </em></strong><br>Number of rooms &lt;= 100</p><p><strong><em>Example 1</em></strong> <br><strong><em>Input </em></strong><br>3 <br>JAABHF JAACJA JAACDA <br>500</p><p><strong><em>Output </em></strong><br>GREEDY <br>105</p><p><strong><em>Explanation</em></strong></p><p>In the reading JAABHF, J represents 0 since it is followed by A, and hence the reading is 000175. Similarly, the other readings are 000200 and 000230. The total of the readings in the rooms is 605 and the central meter reading is 500. Thus the owner is GREEDY and he stole 605–500 = 105 units.</p><p><strong><em>Example 2</em></strong></p><p><strong><em>Input</em></strong></p><p>8</p><p>JAACJA JAABCH JAABHD JAACAF JAJAJJ JAABEJ JAACJJ JAACDI</p><p>1500</p><p><strong><em>Output</em></strong></p><p>INNOCENT</p><p><strong><em>Explanation</em></strong></p><p>The readings are, 000200, 000127, 000173, 000205, 0000099, 000149, 000299, 000238 The sum of these readings is 1490 &lt; 1500, the central meter reading. Hence the owner is INNOCENT.</p><p><strong><em>SOLUTION:</em></strong></p><pre>#include &lt;iostream&gt;</pre><pre>#include &lt;algorithm&gt;</pre><pre>#include &lt;vector&gt;</pre><pre>#include &lt;string&gt;</pre><pre>using namespace std;</pre><pre>vector &lt;int&gt; val(6);</pre><pre>int main()</pre><pre>{</pre><pre>int n, tot = 0, given;</pre><pre>string meter;</pre><pre>cin &gt;&gt; n;</pre><pre>for(int i=0; i&lt;n; i++) {</pre><pre>int p = 1;</pre><pre>int reading = 0;</pre><pre>val = vector &lt;int&gt; (6, 0);</pre><pre>cin &gt;&gt; meter;</pre><pre>for(int j=0; j&lt;6; j++) {</pre><pre>int sm = meter[j] — ‘A’ + meter[j+1] — ‘A’;</pre><pre>if((meter[j] &gt; meter[j+1]) &amp;&amp; (sm == 9)) {</pre><pre>val[j] = sm — (meter[j] — ‘A’);</pre><pre>}</pre><pre>else {</pre><pre>val[j] = meter[j] — ‘A’;</pre><pre>}</pre><pre>}</pre><pre>for(int q=5; q&gt;=0; q — ) {</pre><pre>reading += val[q] * p;</pre><pre>p *= 10;</pre><pre>}</pre><pre>tot += reading;</pre><pre>}</pre><pre>cin &gt;&gt; given;</pre><pre>if(given &lt; tot) {</pre><pre>cout &lt;&lt; “GREEDY\n”;</pre><pre>cout &lt;&lt; tot — given &lt;&lt; “\n”;</pre><pre>}</pre><pre>else {</pre><pre>cout &lt;&lt; “INNOCENT\n”;</pre><pre>}</pre><pre>return 0;</pre><pre>}</pre><p><strong><em>PROBLEM B:<br>NUMBERS WITH NON-DECREASING DIGITS</em></strong></p><p>Some numbers such as 7, 234, 12378 have the digits that are non-decreasing when we read them from left to right. In this problem, we want to find the largest such number less than or equal to a given number N.</p><p><em>Input Format: </em><br>Integer N</p><p><strong><em>Output Format: </em></strong><br>Largest integer M ≤ N that has its digits non-decreasing. The output should not contain leading zeros.</p><p><strong><em>Constraints: </em></strong><br>N &lt;= 10¹⁸</p><p><strong><em>Example 1 </em></strong><br><em>Input </em><br>89</p><p><strong><em>Output </em></strong><br>89</p><p><strong><em>Explanation </em></strong><br>89 itself has non-decreasing digits.</p><p><strong><em>Example 2 </em></strong><br><strong><em>Input </em></strong><br>549</p><p><strong><em>Output </em></strong><br>499</p><p><strong><em>Explanation </em></strong><br>From 500 to 549, the integers have 5 as the leading digit and the second digit must be less than or equal to 4. But then, such a number cannot have its digits non decreasing.</p><p><strong><em>Solution</em></strong></p><pre>#include &lt;iostream&gt;<br>#include &lt;algorithm&gt;<br>#include &lt;vector&gt;<br>using namespace std;<br>vector &lt;int&gt; digits;</pre><pre>int save_digits(long long n) {<br> while(n &gt; 0) {<br> digits.push_back(n % 10);<br> n /= 10;<br> }<br>}<br>bool check_non_decreasing() {<br> if(digits.size() == 1) {<br> return true;<br> }<br> for(int i=0; i&lt;digits.size()-1; i++) {<br> if(digits[i] &gt; digits[i+1]) {<br> return false;<br> }<br> }<br> return true;<br>}</pre><pre>int main() <br>{<br> long long N;<br> cin &gt;&gt; N;<br> long long n = N;<br> int i;<br> save_digits(n);<br> reverse(digits.begin(), digits.end());</pre><pre>if(check_non_decreasing()) <br> cout &lt;&lt; N;<br> else {<br> int sz = digits.size();<br> for(i=sz-1; i&gt;0; i — ) {<br> digits[i] = 9; <br> digits[i-1] — ;<br> if(check_non_decreasing()) <br> break;<br> }<br> for(i=0; i&lt;sz; i++) {<br> if(digits[i] &gt; 0)<br> cout &lt;&lt; digits[i];<br> }<br> <br> cout &lt;&lt; endl;<br> return 0;<br>}</pre><p><strong>PROBLEM C: </strong><br><strong><em>PRIME COUNTERS</em></strong><br>Given a number N, let CP(N) denote the number of primes between 1 and N (inclusive of N). We call N a prime counter if CP(N) is a prime (N need not be a prime). For example, CP(3) = 2, CP(4) = 2, CP(5) = 2, CP(7) = 4.</p><p><strong><em>Input Format: </em></strong><br>An integer T, the number of test cases T lines each containing two positive integers L, R separated by space.</p><p><strong><em>Output Format: </em></strong><br>T lines containing the number of prime counters between L and R (both inclusive) in the ith test case (or NONE is no prime counter exists in that range).</p><p><strong><em>Constraints: </em></strong><br>L ≤ R ≤ 10⁶</p><p><strong><em>Example 1 </em></strong><br><strong><em>Input </em></strong><br>1 <br>1 10</p><p><strong><em>Output </em></strong><br>4</p><p><strong><em>Explanation </em></strong><br>CP(1) = 0, CP(2) = 1, CP(3) = 2, CP(4) = 2, CP(5) = 3, CP(6) = 3, CP(7) = 4= CP(8) = CP(9) = CP(10). Hence there are 4 prime counters, 3, 4, 5, 6 in the range 1 to 10.</p><p><strong><em>Example 2 </em></strong><br><strong><em>Input </em></strong><br>2 <br>2 20 <br>3 30</p><p><strong><em>Output </em></strong><br>8 <br>8</p><p><strong><em>Explanation </em></strong><br>Up to 10, we have 4 prime counters. Between 11 and 20 the prime counters are 11, 12, 17, 18 and hence the count is 8. Between 21 and 30, we have no prime counters.</p><p><strong><em>SOLUTION:</em></strong></p><pre>#include &lt;iostream&gt;<br>#include &lt;algorithm&gt;<br>#include &lt;vector&gt;<br>#include &lt;string&gt;<br>using namespace std;<br>const int N = 1e6 + 3;</pre><pre>int CP[N], PRC[N]; <br>vector &lt;bool&gt; is_prime(N, true);<br>/* For understanding<br>CP[i] — number of primes between 0 and i<br>PRC[i] — number of prime counters between 0 and i<br>is_prime[i] — true if i is prime, false otherwise<br>*/<br>void sieve() {<br> is_prime[0] = is_prime[1] = false;<br> for (int i = 2; i * i &lt;= N; i++) {<br> if (is_prime[i]) {<br> for (int j = i * i; j &lt;= N; j += i)<br> is_prime[j] = false;<br> }<br> } <br>}<br>void counting() {<br> int i;<br> CP[0] = 0;<br> PRC[0] = 0;<br> for(i=1; i&lt;=N; i++) {<br> if(is_prime[i]) {<br> CP[i] = CP[i-1] + 1;<br> }<br> else {<br> CP[i] = CP[i-1];<br> }<br> }<br> for(i=1; i&lt;=N; i++) {<br> if(is_prime[CP[i]]) {</pre><pre>PRC[i] = PRC[i-1] + 1;<br> }<br> else {<br> PRC[i] = PRC[i-1];<br> }<br> }<br> //cout &lt;&lt; endl;<br>}<br>void testcase() {<br> int L, R, ans;<br> cin &gt;&gt; L &gt;&gt; R;<br> if(L == 0) {<br> ans = PRC[R];<br> }<br> else {<br> ans = PRC[R] — PRC[L-1];<br> } <br> cout &lt;&lt; ans &lt;&lt; “\n”;<br>}<br>int main() <br>{<br> sieve();<br> counting();<br> int t;<br> cin &gt;&gt; t;<br> while(t — ) {<br> testcase();<br> } <br> return 0;<br>}</pre><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=2f586ae8bf1d" width="1" height="1" alt=""><hr><p><a href="https://medium.com/guvi/code-vita-questions-and-solutions-1-2f586ae8bf1d">Code Vita Questions and Solutions #1</a> was originally published in <a href="https://medium.com/guvi">Guvi</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Twitter for productivity]]></title>
            <link>https://medium.com/@YogeshSP/twitter-for-productivity-8dee8e54d5e9?source=rss-667175c2430f------2</link>
            <guid isPermaLink="false">https://medium.com/p/8dee8e54d5e9</guid>
            <category><![CDATA[reading]]></category>
            <category><![CDATA[twitter]]></category>
            <dc:creator><![CDATA[Yogesh S P]]></dc:creator>
            <pubDate>Sat, 08 Dec 2018 19:25:09 GMT</pubDate>
            <atom:updated>2018-12-10T04:07:10.754Z</atom:updated>
            <content:encoded><![CDATA[<p>The heading may seem crazy but a lot of my friends keep asking me how do you know so many updates on what’s happening on a particular subject. Ex: Meetups in Chennai, Fantabulous deep dive articles/podcasts from famous Indian tech journalist etc..,</p><p>I always say them it’s simple. I do follow them on Twitter.</p><p>The next question from them will be like “Yeah, I am also on twitter but I don’t get it easily like your saying, even I follow the twitter handles of my interest?”</p><p>So, my dear friends, the answer to the above question is to start using the <strong>Twitter mobile app </strong>and subscribe to push notifications for the handles that you keenly want to know about.</p><p>I feel twitter mobile app is more efficient than web version. So please do download it Twitter app from Google Play or App Store and create an account.</p><p>I will show you how you can see updates from a particular handle.</p><p>Tweets and screenshots from my twitter handle twitter.com/yogeshcodes</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*u1a-61SzSQZQTro0CQUEIA.png" /><figcaption>Screenshot of a Twitter Handle</figcaption></figure><p>A twitter handle will look like above click <strong>bell icon</strong> and choose <strong>All Tweets</strong> to receive updates instantaneously for <strong>tweets</strong> and <strong>retweets</strong>.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/600/1*-AguCDkr_xuOM0BQfLVlnw.png" /></figure><p>If a particular handle tweets or retweets, you will get instant updates on your phone as notifications. You don’t need to hunt any information instead it will reach your hands with no effort.</p><p>The following screenshots show an example for instant notification</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*80GTuZ-Mw43Imezlb4p_8A.png" /></figure><p>If you are a developer or at any job knowing what’s happening on your interest/field is a must.</p><p>So please download twitter mobile app and include updates in your daily diet.</p><p>Pro Tip: Friends and Books should be few is a proverb, likewise number of handles you subscribe to notifications too.</p><p>Thank You!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=8dee8e54d5e9" width="1" height="1" alt="">]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Zoho mail, a newsletter companion]]></title>
            <link>https://medium.com/hackernoon/zoho-mail-a-newsletter-companion-33ced62a23ca?source=rss-667175c2430f------2</link>
            <guid isPermaLink="false">https://medium.com/p/33ced62a23ca</guid>
            <category><![CDATA[email]]></category>
            <category><![CDATA[newsletter]]></category>
            <category><![CDATA[zohomail]]></category>
            <category><![CDATA[mobile-apps]]></category>
            <category><![CDATA[messaging-apps]]></category>
            <dc:creator><![CDATA[Yogesh S P]]></dc:creator>
            <pubDate>Thu, 23 Aug 2018 10:19:54 GMT</pubDate>
            <atom:updated>2019-05-21T04:26:49.329Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/180/1*Q7ENIjaYBSSJfTO2qCoBWQ.png" /></figure><p>When I was in college the thing I loved doing daily is reading. I used to go to the <a href="https://media.licdn.com/media-proxy/ext?w=800&amp;h=800&amp;f=n&amp;hash=0VR2TVUCqqwWB54ZigPRX1AS538%3D&amp;ora=1%2CaFBCTXdkRmpGL2lvQUFBPQ%2CxAVta9Er0Vinkhwfjw8177yE41y87UNCVordEGXyD3u0qYrdf3XhK8KLerLyuQsfLCwclFczffL5FjDiD8C1eNnqdIp1jZXkIY24ZxUBbFI8lWxI"><strong>hostel library</strong></a> for it. It was a rare habit among my (our) generation. My companions for reading and chatting (debating) current affairs was hostel workers whose only hobby (time pass) is hostel library (<strong>Pre-Jio Era in India</strong>).</p><p>I feel the reading habit I developed and developing was very great. I started knowing things that happen around me. I started becoming a different person with the strong reading habit. After joining workforce I developed a taste for tech. The conventional media doesn’t cover much of the things that interest me. The sites I love reading are <a href="https://techcrunch.com/">Techcrunch</a>, <a href="https://factordaily.com/">Factordaily</a>, <a href="http://nextbigwhat.com/">Nextbigwhat</a>, <a href="https://www.livemint.com/">Livemint</a> etc.., It’s really painful to track and read what’s published every day and what’s relevant for me.</p><p>That’s were newsletter comes into play. Every site published a newsletter. Which is very easy to maintain the reading habit. But how do you read all the newsletters without missing it? Is it possible? Can you do that with your regular Gmail account?</p><p>As far as I have seen it’s super hard to read newsletters with Gmail as it has Social, Promotion and other emails it’s really hard to do it in Gmail. Mostly newsletters will come in Updates. You can say why can’t I create a one more Gmail id and do the same. But it’s up to you.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*sDfpfX9Sd_WNqnYlYe-ucw.png" /></figure><p>So I decided to use another <a href="https://hackernoon.com/tagged/email">email</a> service for newsletter alone. I tried another gmail account, Hotmail but it doesn’t workout.</p><blockquote>That’s when I came to know about <a href="https://www.zoho.com/mail/">Zoho Mail</a>. Free for personal use. Intially, it looked strange. But within a week I got comfortable with it. I started using it only for reading newsletter. <a href="https://hackernoon.com/tagged/zoho-mail">Zoho mail</a> has a seperate Tag Type called “Newsletters”. So all the newsletters are automatically delivered to Newsletter folder .It was very easy to use compared with <a href="http://gmail.com/">Gmail</a>.</blockquote><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*yHV_iYS9Et1X32EEUBL1Ww.png" /></figure><p>Zoho mail has a unique design which makes it super easy to read. Zoho mail looks like above screenshot. Three different panes. It’s simply awesome.</p><p><strong>Open in Tab</strong></p><p>I will open the mails that I want to read in new tabs inside the mail. So that I won’t miss out anything. Even gmail doesn’t have this feature.</p><p>It is a very rich reading experience.</p><p><strong>Mobile App</strong></p><p>Nothing moves in the world without mobile apps. I use android so let me tell about android version of Zoho mail.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*g6be9kjBNfeSLXys0qGsHg.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*gojHdw67oNcunjBgdp4--g.png" /></figure><p>Mobile app has some cool features too.</p><p>Read Offline</p><p>Mark all as Read by just clicking the number</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*uhIux5pTctPuAnVBqE_dmA.png" /></figure><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*GhgOY-PDYjWDdxnb55iLQg.png" /></figure><p>Finally, Zoho mail deserves this place in my phone.</p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*94LN7oWjnWA5NOxWDLCS8w.png" /></figure><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fupscri.be%2Fdde502%3Fas_embed%3Dtrue&amp;dntp=1&amp;url=https%3A%2F%2Fupscri.be%2Fhackernoon%2F&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=upscri" width="800" height="400" frameborder="0" scrolling="no"><a href="https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href">https://medium.com/media/3c851dac986ab6dbb2d1aaa91205a8eb/href</a></iframe><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=33ced62a23ca" width="1" height="1" alt=""><hr><p><a href="https://medium.com/hackernoon/zoho-mail-a-newsletter-companion-33ced62a23ca">Zoho mail, a newsletter companion</a> was originally published in <a href="https://medium.com/hackernoon">HackerNoon.com</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>