<?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: Bharathi R</title>
    <description>The latest articles on DEV Community by Bharathi R (@bharathipara).</description>
    <link>https://dev.to/bharathipara</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%2F3542434%2F5b7a7c45-1a02-4ba0-ab9e-5770232cc8c6.png</url>
      <title>DEV Community: Bharathi R</title>
      <link>https://dev.to/bharathipara</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/bharathipara"/>
    <language>en</language>
    <item>
      <title>DLC - 1</title>
      <dc:creator>Bharathi R</dc:creator>
      <pubDate>Thu, 01 Jan 2026 03:54:31 +0000</pubDate>
      <link>https://dev.to/bharathipara/dlc-1-a3i</link>
      <guid>https://dev.to/bharathipara/dlc-1-a3i</guid>
      <description>&lt;p&gt;Hello community! Happy New Year! Within two posts of practicing here, the universe decided to show some kindness, and I got an internship! I took the rest of the year off, so this year I'm hoping to be more productive and advance to the next level!&lt;/p&gt;

&lt;p&gt;That being said, here's the solution i did for today's daily problem on leetcode.&lt;/p&gt;

&lt;p&gt;Problem: 66. Plus One&lt;/p&gt;

&lt;p&gt;Given an array representing a large integer, from left-right (msb-lsb), add 1 and return the new integer in a similar form.&lt;/p&gt;

&lt;p&gt;My first approach:&lt;/p&gt;

&lt;p&gt;&lt;code&gt;&lt;br&gt;
    def plusOne(self, digits: List[int]) -&amp;gt; List[int]:&lt;br&gt;
        dig = int("".join(str(x) for x in digits))&lt;br&gt;
        dig+= 1&lt;br&gt;
        dig = str(dig)&lt;br&gt;
        res = [int(i) for i in dig]&lt;br&gt;
        return res&lt;/code&gt;&lt;/p&gt;

&lt;p&gt;A second approach would be to check if dig[i]==9, if it is, make it zero, and the dig[i-1]+=1. and we return the dig. no str-&amp;gt;int conversions here. &lt;/p&gt;

</description>
      <category>programming</category>
      <category>leetcode</category>
      <category>python</category>
    </item>
    <item>
      <title>CSES-1 Weird Algorithm</title>
      <dc:creator>Bharathi R</dc:creator>
      <pubDate>Thu, 02 Oct 2025 07:39:13 +0000</pubDate>
      <link>https://dev.to/bharathipara/cses-1-weird-algorithm-4pe6</link>
      <guid>https://dev.to/bharathipara/cses-1-weird-algorithm-4pe6</guid>
      <description>&lt;p&gt;Attempt - 1 of the weird algorithm. Upon looking at it, it seems simple. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;if the num is odd, do num*3 + 1&lt;/li&gt;
&lt;li&gt;if it is even, divide by 2&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;keep doing this until your num is 1. &lt;/p&gt;

&lt;blockquote&gt;
&lt;blockquote&gt;
&lt;p&gt;One thing I did struggle a bit was with the output formatting. At this point I'm so used to leetcode style that input-output formatting goes over my head. &lt;/p&gt;
&lt;/blockquote&gt;


&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;Code:&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;n = int(input())
''' the logic: to see odd or even, we check the lsb. that way it is faster than the % function '''
import timeit # this will help in checking for time in local env.
def func(x):
    while x!=1:
        print(x, end= " ")
        if x&amp;amp;1==1:
            x = (x*3) + 1
        else:
            x//=2
    else:
        print(1)

    '''else:
        print("done")'''

start = timeit.default_timer()
func(n)
stop = timeit.default_timer()
#print("time taken: ",stop-start)
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;With this, I'd like to say, Hello, dev world!&lt;/p&gt;

</description>
      <category>programming</category>
    </item>
  </channel>
</rss>
