<?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: Henrique Horbovyi</title>
    <description>The latest articles on DEV Community by Henrique Horbovyi (@henrique_horbovyi).</description>
    <link>https://dev.to/henrique_horbovyi</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%2F70411%2Fed615082-4d89-4589-b489-b1b452aa3563.jpg</url>
      <title>DEV Community: Henrique Horbovyi</title>
      <link>https://dev.to/henrique_horbovyi</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://dev.to/feed/henrique_horbovyi"/>
    <language>en</language>
    <item>
      <title>KOTLIN - EXPRESSÃO WHEN</title>
      <dc:creator>Henrique Horbovyi</dc:creator>
      <pubDate>Sun, 23 Aug 2020 19:46:27 +0000</pubDate>
      <link>https://dev.to/henrique_horbovyi/kotlin-expressao-when-ff1</link>
      <guid>https://dev.to/henrique_horbovyi/kotlin-expressao-when-ff1</guid>
      <description>&lt;p&gt;Está aprendendo kotlin e ainda não sabe quando usar o &lt;em&gt;when&lt;/em&gt;?&lt;/p&gt;

&lt;p&gt;Dá uma conferida nesse vídeo do curso de Kotlin do Rapadura Dev.&lt;/p&gt;

&lt;p&gt;&lt;a href="https://youtu.be/GQQ88-7kn4I"&gt;&lt;br&gt;
&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--g6LSzJDf--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_800/https://dev-to-uploads.s3.amazonaws.com/i/6wntht6bv6czk7cwig55.png" width="800" height="450"&gt;&lt;br&gt;
&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;&lt;span&gt;Photo by &lt;a href="https://unsplash.com/@leliejens?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Jens Lelie&lt;/a&gt; on &lt;a href="https://unsplash.com/s/photos/decision?utm_source=unsplash&amp;amp;utm_medium=referral&amp;amp;utm_content=creditCopyText"&gt;Unsplash&lt;/a&gt;&lt;/span&gt;&lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>beginners</category>
      <category>brasil</category>
      <category>android</category>
    </item>
    <item>
      <title>Kotlin - Val ou Var, qual usar?</title>
      <dc:creator>Henrique Horbovyi</dc:creator>
      <pubDate>Tue, 11 Aug 2020 01:17:46 +0000</pubDate>
      <link>https://dev.to/henrique_horbovyi/kotlin-val-ou-var-qual-usar-2on1</link>
      <guid>https://dev.to/henrique_horbovyi/kotlin-val-ou-var-qual-usar-2on1</guid>
      <description>&lt;p&gt;Olá mundo! &lt;/p&gt;

&lt;p&gt;Esse fim de semana saiu o 3° vídeo do curso de Kotlin, heim!? &lt;/p&gt;

&lt;p&gt;Tá interessad@ ou tem um(a) amigx que tá afim de aprender a linguagem de programação adotada pela Google para criar apps para #android.&lt;/p&gt;

&lt;p&gt;➡️ &lt;a href="https://youtu.be/QuPftWm74LM"&gt;https://youtu.be/QuPftWm74LM&lt;/a&gt; ⬅️&lt;/p&gt;

&lt;p&gt;Manda esse vídeo pra el@&lt;/p&gt;

</description>
      <category>brazil</category>
      <category>kotlin</category>
      <category>beginners</category>
      <category>android</category>
    </item>
    <item>
      <title>Bem-vind@ ao Rapadura Dev</title>
      <dc:creator>Henrique Horbovyi</dc:creator>
      <pubDate>Thu, 06 Aug 2020 00:36:35 +0000</pubDate>
      <link>https://dev.to/henrique_horbovyi/bem-vind-ao-rapadura-dev-1o21</link>
      <guid>https://dev.to/henrique_horbovyi/bem-vind-ao-rapadura-dev-1o21</guid>
      <description>&lt;p&gt;Gostaria de compartilhar com vocês um projeto que comecei recentemente, se trata de um canal no YouTube onde vou postar vídeos todo domingo sobre tecnologias que estão em alta no mercado.&lt;br&gt;
O primeiro curso é sobre a linguagem de programação Kotlin&lt;/p&gt;

&lt;p&gt;Vou ficar muito feliz em ouvir seu feedback 🤗️&lt;/p&gt;

&lt;p&gt;&lt;a href="//youtube.com/rapaduradev"&gt;Rapadura Dev - YouTube&lt;/a&gt;&lt;br&gt;
&lt;a href="//www.instagram.com/rapadura.dev/"&gt;Rapadura Dev - Instagram&lt;/a&gt;&lt;/p&gt;

</description>
      <category>brasil</category>
      <category>brazil</category>
      <category>kotlin</category>
      <category>android</category>
    </item>
    <item>
      <title>Kotlin - Smart Solutions #0</title>
      <dc:creator>Henrique Horbovyi</dc:creator>
      <pubDate>Sun, 12 Apr 2020 20:15:58 +0000</pubDate>
      <link>https://dev.to/henrique_horbovyi/kotlin-smart-solutions-0-6be</link>
      <guid>https://dev.to/henrique_horbovyi/kotlin-smart-solutions-0-6be</guid>
      <description>&lt;p&gt;Hello World, this is the first post of a series in which I want to share to you some cool Kotlin features. &lt;/p&gt;

&lt;h1&gt;
  
  
  The Problem (Make Array Consecutive)
&lt;/h1&gt;

&lt;p&gt;I've faced this problem at &lt;a href="https://codesignal.com/" rel="noopener noreferrer"&gt;Code Signal&lt;/a&gt; (it's a code challenge site). The code challenge description is the follows:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;"Ratiorg got statues of different sizes as a present from CodeMaster for his birthday, each statue having a non-negative integer size. Since he likes to make things perfect, he wants to arrange them from smallest to largest so that each statue will be bigger than the previous one exactly by 1. He may need some additional statues to be able to accomplish that. Help him figure out the minimum number of additional statues needed."&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;b&gt;There is one example to make things more clear&lt;/b&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;For statues = &lt;b&gt;[6, 2, 3, 8]&lt;/b&gt;, the output should be&lt;br&gt;
&lt;b&gt;makeArrayConsecutive&lt;/b&gt;(statues) = &lt;b&gt;3&lt;/b&gt;.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Ratiorg needs statues of sizes &lt;b&gt;4&lt;/b&gt;, &lt;b&gt;5&lt;/b&gt; and &lt;b&gt;7&lt;/b&gt;.&lt;/p&gt;

&lt;h1&gt;
  
  
  The Solution 💡
&lt;/h1&gt;

&lt;p&gt;So basically, we need to &lt;b&gt;sort&lt;/b&gt; all statues and &lt;b&gt;count&lt;/b&gt; the number of missing statues between each one, but how? Take a minute to think about it and then check the solution in the code snippet below.  &lt;/p&gt;

&lt;p&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%2Fi%2F07q2tb5or50gps5i9782.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%2Fi%2F07q2tb5or50gps5i9782.png" alt="The Solution"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h1&gt;
  
  
  Debugging and Understanding 👨‍💻
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;First thing, we need to sort all statues to guarantee that &lt;br&gt;&lt;code&gt;[6, 2, 3, 8]&lt;/code&gt; will become &lt;code&gt;[2, 3, 6, 8]&lt;/code&gt;&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;Next, I used &lt;b&gt;subtract()&lt;/b&gt; method to remove the original list items from a new list which consists in a range between &lt;b&gt;statues.first()&lt;/b&gt; and &lt;b&gt;statues.last()&lt;/b&gt;, which is: &lt;code&gt;statues.first()&lt;b&gt;..&lt;/b&gt;statues.last()&lt;/code&gt;&lt;br&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;This range operation will return an int iterable like: &lt;br&gt;&lt;code&gt;[2, 3, 4, 5, 6, 7, 8]&lt;/code&gt;&lt;br&gt;Then, after &lt;b&gt;subtract()&lt;/b&gt; it will result in this list: &lt;br&gt;&lt;code&gt;[4, 5, 7]&lt;/code&gt;, and that's awesome, these are the missing numbers in the original statues list.&lt;br&gt;
&lt;br&gt;&lt;/p&gt;
&lt;/blockquote&gt;
&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Now, we need to &lt;b&gt;count()&lt;/b&gt; the returned list and we have the final result. Simple no? :D&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Conclusion
&lt;/h1&gt;

&lt;p&gt;In this article, we explored &lt;b&gt;range operator&lt;/b&gt;, &lt;b&gt;subtract&lt;/b&gt;, and &lt;b&gt;count&lt;/b&gt; functions of Kotlin, how to use it and apply it in a problem. &lt;/p&gt;

&lt;p&gt;And if you have some questions, any suggestions, a better solution or even some new ideas for the next &lt;b&gt;Kotlin Smart Solutions&lt;/b&gt; post, don't be shy, let me know and leave me a comment. ;D   &lt;/p&gt;

&lt;p&gt;I hope you learned something new around here.&lt;br&gt;
Thank you!&lt;br&gt;
&lt;b&gt;#KeepLearning&lt;/b&gt;  &lt;/p&gt;

</description>
      <category>kotlin</category>
      <category>beginners</category>
    </item>
    <item>
      <title>HelloWorld("Hey there!")</title>
      <dc:creator>Henrique Horbovyi</dc:creator>
      <pubDate>Sun, 20 May 2018 02:16:06 +0000</pubDate>
      <link>https://dev.to/henrique_horbovyi/helloworldhey-there-mok</link>
      <guid>https://dev.to/henrique_horbovyi/helloworldhey-there-mok</guid>
      <description></description>
    </item>
  </channel>
</rss>
