<?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>Forem: Kushal</title>
    <description>The latest articles on Forem by Kushal (@kushalseth).</description>
    <link>https://forem.com/kushalseth</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%2F210031%2Fea47d062-e285-4658-9d69-f6d464f0d8c1.jpg</url>
      <title>Forem: Kushal</title>
      <link>https://forem.com/kushalseth</link>
    </image>
    <atom:link rel="self" type="application/rss+xml" href="https://forem.com/feed/kushalseth"/>
    <language>en</language>
    <item>
      <title>Want to convert any SQL Query to Mongo DB Query - Shortcut</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Tue, 27 Jul 2021 19:10:50 +0000</pubDate>
      <link>https://forem.com/kushalseth/want-to-convert-any-sql-query-to-mongo-db-query-shortcut-1a45</link>
      <guid>https://forem.com/kushalseth/want-to-convert-any-sql-query-to-mongo-db-query-shortcut-1a45</guid>
      <description>&lt;p&gt;Starting with Mongo DB and confused, how to proceed. MongoDB documents are a good way to proceed. &lt;/p&gt;

&lt;p&gt;But there is an alternative that you can follow. Open any mongoDB GUI tool. Like in my case, I am using free version of &lt;code&gt;No SQL Booster&lt;/code&gt;.&lt;/p&gt;

&lt;p&gt;Suppose you want to convert below query to mongo query:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight plaintext"&gt;&lt;code&gt;select movies.title 
from movies 
inner join ratings on movies.movieId=ratings.movieId 
where movies.genres like '%Children%' 
and ratings.rating&amp;gt;3 
group by movies.title;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;em&gt;Steps:&lt;/em&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  STEP 1: Connect your Mongo DB Query String, and select this SQL as shown in image:
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--dA28FO6o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ip1soquge2qodd37x6e.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--dA28FO6o--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/4ip1soquge2qodd37x6e.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h4&gt;
  
  
  STEP 2: You wll see a text area with mb.runSQLQuery() as shown below. You can write any query, and click on Code. The code will be generated below as shown in image. Don't worry, it converts all the queries, doesnot connect on the database.
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Ssot71DB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5lw7ti2tlij7ssx1rge.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Ssot71DB--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://dev-to-uploads.s3.amazonaws.com/uploads/articles/m5lw7ti2tlij7ssx1rge.png" alt="image"&gt;&lt;/a&gt;&lt;/p&gt;

</description>
      <category>mongodb</category>
      <category>sql</category>
      <category>mysql</category>
      <category>query</category>
    </item>
    <item>
      <title>Do you know what is SpaceX Starlink and Who are the New Infra providers like Microsoft, Google partnering with Starlink</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Thu, 13 May 2021 23:09:18 +0000</pubDate>
      <link>https://forem.com/kushalseth/do-you-know-what-is-spacex-starlink-and-who-are-the-new-infra-providers-like-microsoft-google-partnering-with-starlink-1dgj</link>
      <guid>https://forem.com/kushalseth/do-you-know-what-is-spacex-starlink-and-who-are-the-new-infra-providers-like-microsoft-google-partnering-with-starlink-1dgj</guid>
      <description>&lt;h1&gt;
  
  
  What is Elon Musk's Starlink network?
&lt;/h1&gt;

&lt;p&gt;Starlink is a satellite internet constellation being constructed by SpaceX providing satellite Internet access. - wiki&lt;/p&gt;

&lt;p&gt;High-speed, low latency broadband internet. Starlink is now delivering initial beta service both domestically and internationally, and will continue expansion to near global coverage of the populated world in 2021. As of now (2021), around 1500+ Starlink satellites are there in orbit. and do you know they are targeting around 42,000 Starlink satellites by 2027.  &lt;/p&gt;

&lt;h1&gt;
  
  
  Why SpaceX Starlink
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Latency is the time it takes to send data from one point to the next. When satellites are far from Earth, latency is high, resulting in poor performance for activities like video calls and online gaming.&lt;/li&gt;
&lt;li&gt;Starlink satellites are over 60 times closer to Earth than traditional satellites, resulting in lower latency and the ability to support services typically not possible with traditional satellite internet. &lt;/li&gt;
&lt;li&gt;Starlink is ideally suited for areas of the globe where connectivity has typically been a challenge. Unbounded by traditional ground infrastructure, Starlink can deliver high-speed broadband internet to locations where access has been unreliable or completely unavailable.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Why cloud Providers wants to Integrate to SpaceX Starlink
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;The collaboration between Starlink and cloud providers will allow, cloud providers to deliver new offerings for both the public and the private sector. &lt;/li&gt;
&lt;li&gt;Cloud providers can provide better computing pro capabilities in hybrid or challenging environments, including remote areas.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Some of the key providers are in Race to connect with SpaceX Starlink.&lt;/p&gt;

&lt;h1&gt;
  
  
  Microsoft partners with SpaceX Starlink
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Microsoft partners with SpaceX Starlink to connect to Azure cloud on Oct 2020.&lt;/li&gt;
&lt;li&gt;Azure has launched it's new service named Azure Orbital, this will connect satellites with the cloud.&lt;/li&gt;
&lt;li&gt;Starlink will connect with new "Azure Modular Datacenters".&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Google partners with SpaceX Starlink
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;GoogleCloud partners with SpaceX Starlink to connect to  Google CLoud on May 2021.&lt;/li&gt;
&lt;li&gt;Starlink satellites will connect with Google’s private fiber-optic network&lt;/li&gt;
&lt;li&gt;SpaceX will install ground stations at Google data centers.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Amazon: As of now has not partnered with SpaceX starlink
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;How can we forget Amazon when talking about service providers.&lt;/li&gt;
&lt;li&gt;Amazon offers a service to connect its AWS cloud to satellites and is working on a competitor to Starlink called Kuiper.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay tuned with me. I love this topic, will continue to publish more.  &lt;/p&gt;

</description>
      <category>googlecloud</category>
      <category>azurecloud</category>
      <category>100daysofcloud</category>
      <category>cloud</category>
    </item>
    <item>
      <title>Good Resources for Blockchain Journey</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Wed, 07 Apr 2021 22:45:26 +0000</pubDate>
      <link>https://forem.com/kushalseth/good-resources-for-blockchain-journey-28la</link>
      <guid>https://forem.com/kushalseth/good-resources-for-blockchain-journey-28la</guid>
      <description>&lt;p&gt;Hey everyone today someone asked me to share some of the good resources for Blockchain. I advised him not to get into the trap of highly marked courses. Better to follow these people or groups and participate in hackathons hosted by these groups.&lt;/p&gt;

&lt;p&gt;And if you are a college student then please focus on your syllabus as well. :)&lt;/p&gt;

&lt;p&gt;The List sequence doesn't hold any importance. But they all hold a good position in Blockchain world. Will keep updating the list. but for the first look, these names came to my mind. There are some Indian influencers who are contributing in Blockchain, will be adding them in this or next article.&lt;/p&gt;

&lt;p&gt;It’s hard to start, so I would suggest to go through these list and understand what is going on.&lt;/p&gt;

&lt;h2&gt;
  
  
  Good courses to follow, (Follow the groups as well to get updated informations): (Directly try these courses from these websites)
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://cryptozombies.io/en/course/"&gt;https://cryptozombies.io/en/course/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://docs.soliditylang.org/en/v0.8.3/solidity-by-example.html"&gt;https://docs.soliditylang.org/en/v0.8.3/solidity-by-example.html&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;
&lt;a href="https://www.hyperledger.org/use/tutorials"&gt;https://www.hyperledger.org/use/tutorials&lt;/a&gt;
— &lt;a href="https://developer.ibm.com/tutorials/cl-ibm-blockchain-101-quick-start-guide-for-developers-bluemix-trs/"&gt;https://developer.ibm.com/tutorials/cl-ibm-blockchain-101-quick-start-guide-for-developers-bluemix-trs/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://cognitiveclass.ai/courses/blockchain-course"&gt;https://cognitiveclass.ai/courses/blockchain-course&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Full theory and u will get certifcate in association with IIT &lt;a href="https://nptel.ac.in/courses/106/105/106105184/"&gt;https://nptel.ac.in/courses/106/105/106105184/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ethereum.org/en/developers/tutorials/"&gt;https://ethereum.org/en/developers/tutorials/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://ethereum.org/en/defi/"&gt;https://ethereum.org/en/defi/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://web3js.readthedocs.io"&gt;https://web3js.readthedocs.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://infura.io"&gt;https://infura.io&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://www.iota.org"&gt;https://www.iota.org&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://consensys.net/blockchain-use-cases/decentralized-finance/"&gt;https://consensys.net/blockchain-use-cases/decentralized-finance/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Signal&lt;/li&gt;
&lt;li&gt;and technologies that u should be good at MERN, GO, NodeJS&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/MetaMask"&gt;https://twitter.com/MetaMask&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;DFTs&lt;/li&gt;
&lt;li&gt;Latest block chain launches&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Groups to follow for News, updates or hackathons by these groups:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://devfolio.co/home/"&gt;https://devfolio.co/home/&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://devpost.com"&gt;https://devpost.com&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ETHGlobal"&gt;https://twitter.com/ETHGlobal&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ETHIndiaco"&gt;https://twitter.com/ETHIndiaco&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ConsenSysIndia"&gt;https://twitter.com/ConsenSysIndia&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/Coinbase"&gt;https://twitter.com/Coinbase&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/LibraReserve"&gt;https://twitter.com/LibraReserve&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/BinanceChain"&gt;https://twitter.com/BinanceChain&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/NEARProtocol"&gt;https://twitter.com/NEARProtocol&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/CryptoKitties"&gt;https://twitter.com/CryptoKitties&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ForbesCrypto"&gt;https://twitter.com/ForbesCrypto&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/Tronfoundation"&gt;https://twitter.com/Tronfoundation&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/binance"&gt;https://twitter.com/binance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/trufflesuite"&gt;https://twitter.com/trufflesuite&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/0xProject"&gt;https://twitter.com/0xProject&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/NEMofficial"&gt;https://twitter.com/NEMofficial&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/CoinDesk"&gt;https://twitter.com/CoinDesk&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/Ripple"&gt;https://twitter.com/Ripple&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/litecoin"&gt;https://twitter.com/litecoin&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Peoples to follow:
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ethereumJoseph"&gt;https://twitter.com/ethereumJoseph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/cz_binance"&gt;https://twitter.com/cz_binance&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/justinsuntron"&gt;https://twitter.com/justinsuntron&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/DavidSonstebo"&gt;https://twitter.com/DavidSonstebo&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/ethereumJoseph"&gt;https://twitter.com/ethereumJoseph&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/hudsonjameson"&gt;https://twitter.com/hudsonjameson&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/VitalikButerin"&gt;https://twitter.com/VitalikButerin&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/TheRealKartik"&gt;https://twitter.com/TheRealKartik&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/thebitsian"&gt;https://twitter.com/thebitsian&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/tyler"&gt;https://twitter.com/tyler&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;&lt;a href="https://twitter.com/dandoll"&gt;https://twitter.com/dandoll&lt;/a&gt;&lt;/li&gt;
&lt;/ol&gt;

&lt;h2&gt;
  
  
  Other then blockchain, you can explore these groups
&lt;/h2&gt;

&lt;ol&gt;
&lt;li&gt;&lt;a href="https://twitter.com/googledevgroups"&gt;https://twitter.com/googledevgroups&lt;/a&gt;&lt;/li&gt;
&lt;li&gt;Microsoft developers&lt;/li&gt;
&lt;li&gt;codeforces.com&lt;/li&gt;
&lt;/ol&gt;

&lt;p&gt;There are some Indian influencers who are contributing in Blockchain, will be adding them in this or next article.&lt;/p&gt;

&lt;p&gt;Thankyou. For more queries or information on how to star or work with Blockchain, please feel free to connect on any platform&lt;/p&gt;

&lt;h1&gt;
  
  
  100DaysOfBlockchain #abc_vi
&lt;/h1&gt;

</description>
      <category>blockchain</category>
      <category>100daysofblockchain</category>
      <category>blockchaintechnology</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>First Look at Crystal Programming</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Fri, 29 Jan 2021 18:37:48 +0000</pubDate>
      <link>https://forem.com/kushalseth/first-look-at-crystal-programming-3ic5</link>
      <guid>https://forem.com/kushalseth/first-look-at-crystal-programming-3ic5</guid>
      <description>&lt;p&gt;Today, I was exploring a new Language "Crystal Programming Language". It has more then 15k stars on &lt;a href="https://github.com/crystal-lang/crystal/stargazers"&gt;GitHub&lt;/a&gt; as on Jan, 2021&lt;/p&gt;

&lt;h1&gt;
  
  
  How it all Started
&lt;/h1&gt;

&lt;p&gt;It has an interesting start, It was started as an experiment by Manastech in 2012 by three members: Ary, Juan and Brian. The first official release came on Jun 18, 2014&lt;/p&gt;

&lt;h3&gt;
  
  
  In Ary’s own words, why Crystal Programming Language was started:
&lt;/h3&gt;

&lt;blockquote&gt;
&lt;p&gt;At Manas we really like Ruby and use it a lot, &lt;br&gt;
but we feel a bit sad when it’s slow and &lt;br&gt;
we have to migrate our code to another language. &lt;br&gt;
We wished there was a language like Ruby, &lt;br&gt;
only faster and more type safe. &lt;br&gt;
We realized, due to Ruby’s dynamic nature, &lt;br&gt;
that it would be impossible to make Ruby work like that, &lt;br&gt;
so we started our own language.&lt;/p&gt;

&lt;p&gt;As many of the things we do at Manas, &lt;br&gt;
Crystal was created to solve a problem. &lt;br&gt;
If it doesn’t exist, why not create it?&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  What is Crystal programming Language
&lt;/h1&gt;

&lt;p&gt;Crystal is an Object Oriented, statically-typed and structured programming language with build-in type-checks and syntax close to Ruby, and gives performance close to c/c++. &lt;/p&gt;

&lt;p&gt;Most Dynamic programing languages, operations can be done at compile and run time both. For example, in JavaScript it is possible to change the type of a variable or add new properties or methods to an object while the program is running. The compile-time static type checks of Crystal Programming provides an additional safety layer which proves invaluable in larger code-bases, a problem faced by several long-running projects built on dynamic languages.  &lt;/p&gt;

&lt;p&gt;As mentioned on the crystal official &lt;a href="https://crystal-lang.org/reference/"&gt;site&lt;/a&gt;, Crystal programming language focuses on &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Have a syntax similar to Ruby (but compatibility with it is not a goal).&lt;/li&gt;
&lt;li&gt;Be statically type-checked, but without having to specify the type of variables or method arguments.&lt;/li&gt;
&lt;li&gt;Be able to call C code by writing bindings to it in Crystal.&lt;/li&gt;
&lt;li&gt;Have compile-time evaluation and generation of code, to avoid boilerplate code.&lt;/li&gt;
&lt;li&gt;Compile to efficient native code.&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Write Your First Program
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;First Official Post of Hello World by Juan and Ary: (10 Jul 2013) &lt;a href="https://crystal-lang.org/2013/07/10/hello-world.html"&gt;https://crystal-lang.org/2013/07/10/hello-world.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Getting Started: &lt;a href="https://crystal-lang.org/reference/getting_started/index.html"&gt;https://crystal-lang.org/reference/getting_started/index.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Try the online editor: &lt;a href="https://play.crystal-lang.org/#/cr"&gt;https://play.crystal-lang.org/#/cr&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Crystal Programming Language Influencers, Developers and Handlers
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Raw Crystal 2020 (first community-driven conference for the Crystal language): &lt;a href="https://www.youtube.com/playlist?list=PLfpFq_WLOW__RIIyWvTgYV4bw2cpav2mJ"&gt;Presentations Link&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Ary Borenzweig: &lt;a href="https://twitter.com/asterite"&gt;https://twitter.com/asterite&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Juan Wajnerman: &lt;a href="https://github.com/waj"&gt;https://github.com/waj&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Brian J. Cardiff: &lt;a href="https://github.com/bcardiff"&gt;https://github.com/bcardiff&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Lorenzo Barasti: &lt;a href="https://twitter.com/lbarasti"&gt;https://twitter.com/lbarasti&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Crystal Language: &lt;a href="https://twitter.com/CrystalLanguage"&gt;https://twitter.com/CrystalLanguage&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Manas tech: &lt;a href="https://twitter.com/manastech"&gt;https://twitter.com/manastech&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;h1&gt;
  
  
  Official Links
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Story of Crystal Programming - &lt;a href="https://manas.tech/blog/2016/04/01/the-story-behind-crystal/"&gt;https://manas.tech/blog/2016/04/01/the-story-behind-crystal/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Language Reference - &lt;a href="https://crystal-lang.org/reference/"&gt;https://crystal-lang.org/reference/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Language Git Page: &lt;a href="https://crystal-lang.org"&gt;https://crystal-lang.org&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Release Notes: &lt;a href="https://crystal-lang.org/api/0.36.0/toplevel.html"&gt;https://crystal-lang.org/api/0.36.0/toplevel.html&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;Crystal Blogs: &lt;a href="https://crystal-lang.org/blog/"&gt;https://crystal-lang.org/blog/&lt;/a&gt;
&lt;/li&gt;
&lt;li&gt;StackOverFlow: &lt;a href="https://stackoverflow.com/questions/tagged/crystal-lang"&gt;https://stackoverflow.com/questions/tagged/crystal-lang&lt;/a&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Crystal Programming Language is impressive by first look, Will deep dive more later on some other day. Next I will be diving to First Look of Q#. Stay with me.&lt;/p&gt;

&lt;p&gt;I explore new technologies, languages, and deep dive into the new technical topics. Thanks for staying with me.  &lt;/p&gt;

</description>
      <category>rawcrystal2020</category>
      <category>crystallanguage</category>
      <category>crystallang</category>
      <category>ruby</category>
    </item>
    <item>
      <title>[3] Step by Step solution | Find the Second Largest element in array using C# | Java</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Tue, 26 Jan 2021 16:57:22 +0000</pubDate>
      <link>https://forem.com/kushalseth/step-by-step-solution-find-the-second-largest-element-in-array-using-c-java-55fp</link>
      <guid>https://forem.com/kushalseth/step-by-step-solution-find-the-second-largest-element-in-array-using-c-java-55fp</guid>
      <description>&lt;p&gt;So, the problem statement is we have to find out the second largest element in the array.&lt;/p&gt;

&lt;p&gt;To, start you can always start with dividing the problem into pieces. So, you can think of the way how to find the largest element first.&lt;/p&gt;

&lt;p&gt;So, suppose you have a array, &lt;code&gt;{10, 1, 2, 33, 12}&lt;/code&gt; So the second largest element inside the array is 12. &lt;/p&gt;

&lt;p&gt;How should you proceed, don't worry in the beginning how many loops you have to use, Just try to think how you should start on this problem. &lt;/p&gt;

&lt;p&gt;If we take the first element, ie &lt;code&gt;10&lt;/code&gt;, then that will be the largest, then when we move forward and pick &lt;code&gt;1&lt;/code&gt;. &lt;code&gt;1&lt;/code&gt; will be the second largest.&lt;/p&gt;

&lt;p&gt;What we are doing in last para is, we are basically traversing the elements. Means, we need one array here.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MinValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;

            &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt;
            &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;What we just did is, we checked if our arr[i] is greater then largest, if that context element is largest then that will become the largest. &lt;/p&gt;

&lt;p&gt;Let's extend the program, take &lt;code&gt;1&lt;/code&gt;. This &lt;code&gt;1&lt;/code&gt; will become the second largest, that means something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MinValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secondlargest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MinValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt;
            &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 
                    &lt;span class="n"&gt;secondlargest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, pick &lt;code&gt;2&lt;/code&gt; from the array, this &lt;code&gt;2&lt;/code&gt; is greater then &lt;code&gt;1&lt;/code&gt; and smaller then &lt;code&gt;10&lt;/code&gt;. we have to put this condition now in the code. So, this is the situation of else. in else if, we have to put this logic, let's put it..&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MinValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secondlargest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MinValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt;
            &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secondlargest&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 
                    &lt;span class="n"&gt;secondlargest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, let's pick &lt;code&gt;33&lt;/code&gt;, now 33 is greater then largest number. So, we need to put &lt;code&gt;33&lt;/code&gt; in largest, and my largest will become the second largest. sounds logical!! Let's put last piece of code.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MinValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;secondlargest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt;&lt;span class="na"&gt;MinValue&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="mi"&gt;0&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;++)&lt;/span&gt;
            &lt;span class="o"&gt;{&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
                &lt;span class="o"&gt;{&lt;/span&gt;
                    &lt;span class="n"&gt;secondlargest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt;&lt;span class="o"&gt;;&lt;/span&gt;
                    &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
                &lt;span class="k"&gt;else&lt;/span&gt; &lt;span class="nf"&gt;if&lt;/span&gt;&lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;largest&lt;/span&gt; &lt;span class="o"&gt;&amp;amp;&amp;amp;&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;secondlargest&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt; 
                    &lt;span class="n"&gt;secondlargest&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
                &lt;span class="o"&gt;}&lt;/span&gt;
            &lt;span class="o"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Now, our code is complete. Hope you liked this journey. Video available at &lt;a href="https://www.youtube.com/watch?v=angBdWeAxd8&amp;amp;t=205s"&gt;https://www.youtube.com/watch?v=angBdWeAxd8&amp;amp;t=205s&lt;/a&gt; &lt;/p&gt;

&lt;p&gt;Git Links:&lt;br&gt;
C#: &lt;a href="https://github.com/kushalseth/DataStructure/blob/master/CodingProblems/CodingProblems/ArrayProblems/SecondLargestInArray.cs"&gt;https://github.com/kushalseth/DataStructure/blob/master/CodingProblems/CodingProblems/ArrayProblems/SecondLargestInArray.cs&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Java: &lt;a href="https://github.com/kushalseth/DataStructure/blob/master/javadatastructure/src/Main.java"&gt;https://github.com/kushalseth/DataStructure/blob/master/javadatastructure/src/Main.java&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Stay Connected for more informative stuff on React, Javascript, Algorithms, Blockchain, DataStructures, etc&lt;/p&gt;

</description>
      <category>100daysofcode</category>
      <category>datastructure</category>
      <category>algorithms</category>
      <category>array</category>
    </item>
    <item>
      <title>[1] Learning french for beginner</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Sun, 23 Aug 2020 18:27:49 +0000</pubDate>
      <link>https://forem.com/kushalseth/1-learning-french-for-beginner-453h</link>
      <guid>https://forem.com/kushalseth/1-learning-french-for-beginner-453h</guid>
      <description>&lt;h1&gt;
  
  
  Learning french for beginner 🔰
&lt;/h1&gt;

&lt;h4&gt;
  
  
  Leaning a new language is as interesting as learning a new programming language
&lt;/h4&gt;

&lt;p&gt;I am totally new in this, this is the first time I am learning a language which is not a programming language. This is my second day. I will be discussing my journey of learning and challenges I have faced or will face while learning a new language. Discussing something along the process is a great idea, as I will actually be able to share the actual challenges that I have faced or will face along the path.&lt;/p&gt;

&lt;p&gt;So, things started when I was thinking to apply for my Canada PR. I got to know, If I clears the second language exam, I will get some points for PR. &lt;/p&gt;

&lt;p&gt;On first day, I searched a lot and got to know that in a year or so, I can easily learn French. &lt;/p&gt;

&lt;p&gt;Now what, learning has started. and truly friends, it's not at all easy to grasp that pronunciation of a new language. I tried and listened lots of videos and didn't able to get that confidence that I can learn a new language. Forget about PR points, I was not sure, will I be able to learn french or not.&lt;/p&gt;

&lt;p&gt;I was sure that getting a score in french for PR will not be easy. &lt;strong&gt;But somewhere on that day I got fallen in love with learning a new language.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;So, few days later, I met my nephew. He is just 12 years old and he is learning Spanish as course curriculum. I asked my sister to arrange all the books that he has read for Spanish. There were around 4 books that he has read since last 4 years. I have observed them, and what I found is, we have to start just like a kid starts from A for Apple and B for Ball, then learning new words, then sentences, grammar, paragraphs.&lt;/p&gt;

&lt;p&gt;Now, I know, I have to start with alphabets. I got some confidence and direction. But, what to do with the pronunciation. Toughest part, as I was not confident in that part.&lt;/p&gt;

&lt;p&gt;Today, I was reading and listening lot of videos but was not able to grasp if I am pronouncing it correctly or not.&lt;/p&gt;

&lt;p&gt;Suddenly a trick worked for me. I was searching around, and got an awesome way to know, if my pronunciation is correct or not.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;The way is to know, how that letter will sound if we put that in an English word.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's start with Vowels in this series;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Letter 'A'  (ahh)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pronunciation of letter &lt;strong&gt;'A'&lt;/strong&gt; in French is 

&lt;ul&gt;
&lt;li&gt;like &lt;strong&gt;'A'&lt;/strong&gt; in English word &lt;strong&gt;father&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;like &lt;strong&gt;'A'&lt;/strong&gt; in English word &lt;strong&gt;spa&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Letter 'E'  (ay)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pronunciation of letter &lt;strong&gt;'E'&lt;/strong&gt; in French is

&lt;ul&gt;
&lt;li&gt;like &lt;strong&gt;'ay'&lt;/strong&gt; in English word &lt;strong&gt;say&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Letter 'I'  (ee)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pronunciation of letter &lt;strong&gt;'I'&lt;/strong&gt; in French is

&lt;ul&gt;
&lt;li&gt;like &lt;strong&gt;'ee'&lt;/strong&gt; in English word &lt;strong&gt;bee&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Letter 'O'&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;The pronunciation of letter &lt;strong&gt;'O'&lt;/strong&gt; in French can be in two ways&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;Close &lt;strong&gt;'O'&lt;/strong&gt;: "O" is always pronounced like this when it is the last word in a sentence. or is followed by 'z' sound. 

&lt;ul&gt;
&lt;li&gt; Pronounced like &lt;strong&gt;'o'&lt;/strong&gt; in English word &lt;strong&gt;go&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;Open &lt;strong&gt;'O'&lt;/strong&gt;: "O" is always pronounced like this when it is followed by any consonant sound other than [z], 

&lt;ul&gt;
&lt;li&gt; Pronounced like &lt;strong&gt;short 'u' sound&lt;/strong&gt; in English word &lt;strong&gt;son&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Letter 'U'  (ooh)&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pronunciation of letter &lt;strong&gt;'U'&lt;/strong&gt; in French is really hard, 

&lt;ul&gt;
&lt;li&gt;touch your tongue to the bottom teethes and say &lt;strong&gt;ee&lt;/strong&gt; as in bee. then round your lips (don't lift your tongue) and say &lt;strong&gt;ooh&lt;/strong&gt; without moving our lips.&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;Letter 'Y'&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The pronunciation of letter &lt;strong&gt;'Y'&lt;/strong&gt; in French can be in 2 ways;

&lt;ul&gt;
&lt;li&gt;Like a vowel. It will sound like "y" in &lt;strong&gt;happy&lt;/strong&gt;. Somewhat similar to &lt;strong&gt;I&lt;/strong&gt;
&lt;/li&gt;
&lt;li&gt;Like a consonant, if Y is at the starting then it will sound like 'Y' in english.
&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am not sure, if I willvbe able to clear french examination. But yeah, I will surely learn this. Hope this has helped you. &lt;/p&gt;

&lt;p&gt;Always feel free to connect with me on any of the platform you love. &lt;strong&gt;Stay Connected, Stay Save and Let's Build together.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>developerslife</category>
      <category>learnfrench</category>
      <category>developers</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>One Live Product </title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Sun, 23 Aug 2020 00:56:50 +0000</pubDate>
      <link>https://forem.com/kushalseth/one-live-product-2chc</link>
      <guid>https://forem.com/kushalseth/one-live-product-2chc</guid>
      <description>&lt;h1&gt;
  
  
  One Live Product 🚁
&lt;/h1&gt;

&lt;h4&gt;
  
  
  #OneLiveProduct is about the journey of an entrepreneur towards it's first product that can be leveled up as startup.
&lt;/h4&gt;

&lt;p&gt;&lt;a href="https://res.cloudinary.com/practicaldev/image/fetch/s--Bmzjj0dW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/10295411/90968390-5878ce80-e509-11ea-967f-bcc42ef3ff60.png" class="article-body-image-wrapper"&gt;&lt;img src="https://res.cloudinary.com/practicaldev/image/fetch/s--Bmzjj0dW--/c_limit%2Cf_auto%2Cfl_progressive%2Cq_auto%2Cw_880/https://user-images.githubusercontent.com/10295411/90968390-5878ce80-e509-11ea-967f-bcc42ef3ff60.png" alt="OneLiveProduct"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;I was sitting at home and thinking, what am I doing? Does that has any worth? &lt;/p&gt;

&lt;p&gt;Due to curiosity, I started searching more about this topic and I saw so many people are doing great work in coding, writing, designing etc. But isn't their work deserves more. Or their should be something that shows their true presence and journey that they have covered or wants to cover as entrepreneur. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;One Live Product&lt;/strong&gt; is about the same, let's give yourself some time and think, Is their any product that is your dream and you want to make it live to users. If yes, start posting about your product journey even if it is just a thought.&lt;/p&gt;

&lt;p&gt;Might be people will love your concept and you may get help and support of any kind you want. Or, you may get your first few users. &lt;/p&gt;

&lt;p&gt;You can share anything you want towards your journey of your dream. But we cautious that you are representing your dream project. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Our AIM out of #OneLiveProduct is:&lt;/strong&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;Build your dream product and make it Live. Start posting from the day you thought you just want to build your dream product. &lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;You can take days to think and just post about whatever you feel like: how have you chosen the product you are developing, what are your learning, impact and growth, etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;It's not about updating on social media mandatorily, you may or may not  post daily but don't post irrelevant information like: I have completed 10 days of  #OneLiveProduct. These kind of information is not at all helpful and you may loose your actual users. Instead of posting like that. You can post about your thoughts on the problem, start some quiz, ask some questions or share some resources that are helpful, ask questions that are relevant to your product requirements  or share module update or ask users for review,  etc.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Have some actual users on boarded and this journey will help you to connect with your initial users.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;Connect with other people following #OneLiveProduct to understand their journey and how they are handling problems of making a product live with actual users.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;strong&gt;You can join &lt;a href="https://www.facebook.com/groups/632100480809375"&gt;facebook&lt;/a&gt; and &lt;a href="https://www.linkedin.com/groups/8974208/"&gt;linkedIn&lt;/a&gt; groups of #OneLiveProduct.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Always feel free to connect with me on any of the platform you love. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stay Connected, Stay Save and Let's Build together.&lt;/strong&gt;&lt;/p&gt;

</description>
      <category>oneliveproduct</category>
      <category>challenge</category>
      <category>developerlife</category>
      <category>entrepreneurlife</category>
    </item>
    <item>
      <title>[2] Specificity and Cascading  in CSS</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Thu, 20 Aug 2020 20:16:20 +0000</pubDate>
      <link>https://forem.com/kushalseth/part-2-css-for-developers-cascading-in-css-1deb</link>
      <guid>https://forem.com/kushalseth/part-2-css-for-developers-cascading-in-css-1deb</guid>
      <description>&lt;h1&gt;
  
  
  Cascading and Specificity in CSS ☕
&lt;/h1&gt;

&lt;p&gt;It's second post in #CSSForDevelopers series. The purpose of calling this #CSSForDevelopers is because developers sometime have tough time to connect with CSS. but #CSS is also an important aspect if you are moving towards full stack development or architecture an application. &lt;/p&gt;

&lt;p&gt;In #CSSForDevelopers series, I will be posting the CSS concepts from basics of CSS to styling a #react component.&lt;/p&gt;

&lt;h4&gt;
  
  
  What is Cascading. So, what is the problem that we are trying to solve?
&lt;/h4&gt;

&lt;p&gt;Here we have a stylesheet where we may have different styles defined for the same element. &lt;/p&gt;

&lt;p&gt;Look at this example, where we are trying to give color to body as well as to the div. The div is inside body. So, now what will be the background-color of Div? What will happen when you don't have background-color set specially for div? These are some of the open questions that we will be answering in this post.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;The sample HTML that we will be using is at this &lt;a href="https://gist.github.com/kushalseth/dfa9c1975ad091a9a25f5148cd7af88e" rel="noopener noreferrer"&gt;GIST Link&lt;/a&gt;: You can copy the code from here on paste to any online editor like repl.it&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;&lt;strong&gt;TRY IT YOURSELF 1&lt;/strong&gt;&lt;/p&gt;

&lt;h5&gt;
  
  
  CSS Code:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt;  &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ffff00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;yellow&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;red&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nc"&gt;.abc-myclass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="no"&gt;orange&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;orange&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h5&gt;
  
  
  HTML Code:
&lt;/h5&gt;



&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;This is h1 directly under body&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt;  &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"abc-myclass"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt; Test class attribute para &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;I am h2 directly under div&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt;  &lt;span class="na"&gt;data-test=&lt;/span&gt;&lt;span class="s"&gt;"001"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is para inside div, but not directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt;  &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"abc-myclass"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is para directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&lt;/span&gt;
            &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside span&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;

    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt;  &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"myclass"&lt;/span&gt;  &lt;span class="na"&gt;data-test=&lt;/span&gt;&lt;span class="s"&gt;"001"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;I am paragraph directly inside the body and below a div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;a&lt;/span&gt;  &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"github.com/kushalseth"&lt;/span&gt;  &lt;span class="na"&gt;target=&lt;/span&gt;&lt;span class="s"&gt;"_blank"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;GIT rofile&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Expected Output:&lt;/strong&gt;&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%2Fuser-images.githubusercontent.com%2F10295411%2F90067233-6ca01d00-dd0c-11ea-810e-27a0ca8f8a81.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%2Fuser-images.githubusercontent.com%2F10295411%2F90067233-6ca01d00-dd0c-11ea-810e-27a0ca8f8a81.png" alt="Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;This is the problem that we are going to talk about in this post. Stay with me for sometime.  &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;Note:&lt;/strong&gt; If you know the very basics, you can directly jump to below heading: "PART-2: Different style is applied through multiple resources on the same element.". That has information on how specificity works.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Understanding Cascade
&lt;/h2&gt;

&lt;p&gt;Styles can come from multiple sources, so we need to understand which style will be applied to the element. &lt;/p&gt;

&lt;p&gt;Wondering, How you will have multiple styles? This is because, we may have&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Author stylesheets (inline- css or third party style sheets),&lt;/strong&gt; These are the style sheets that we load in our application. It could be our application's stylesheet or some third party stylesheet that gets loaded when we include third parties.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;User stylesheets,&lt;/strong&gt; Behavior that can be added to any web page when opened in your browser. Each browser has settings to set the style based on user preference to all the pages that we open. You can update that as well. Suppose you want font to be bold for all the webpages that you open in a browser, you can do that from the settings of browser. These kind of style sheets are called User Stylesheets.&lt;/p&gt;&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Browser default style sheets (user agent style sheets):&lt;/strong&gt; Each browser has some pre-defined CSS for the elements known as user agent stylesheets. Each browser has it's own way of handling the default styles for the tags. Few developers prefer to reset the default stylesheets to have a more control over the application across the browsers. They define default styles for all the elements in a CSS.&lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;🔺 &lt;strong&gt;So, our First rule is:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;The Order of preference if all three are applied on the same element is: (The style with more weight will be applied) &lt;/p&gt;


&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-&amp;gt; Least weight to Most weight
-&amp;gt; Browser default style sheets -&amp;gt; User stylesheets -&amp;gt; Author stylesheets
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;So, suppose we have &lt;strong&gt;browser default style sheet&lt;/strong&gt; as well as &lt;strong&gt;User Stylesheet&lt;/strong&gt; on the element, then userstylesheet will be preferred, and you can see the style mentioned in userstylesheet.&lt;/p&gt;

&lt;p&gt;In the same way, if you &lt;strong&gt;browser default style sheet&lt;/strong&gt; as well as &lt;strong&gt;author defined style sheet&lt;/strong&gt;, then author defined style sheet will be applied to the element. But if you use !important in user stylesheet for any style  then that would be preferred over author stylesheets,&lt;/p&gt;

&lt;p&gt;Now, in next heading, let's discuss how, cascading would work when we have multiple author based stylesheets.&lt;/p&gt;

&lt;h2&gt;
  
  
  Rules for Author defined style sheets:
&lt;/h2&gt;

&lt;h4&gt;
  
  
  PART-I: Same style is applied through multiple resources on the same element.
&lt;/h4&gt;

&lt;p&gt;Now, we know, &lt;strong&gt;author defined cascading rules have highest priority&lt;/strong&gt;. What will happen in the scenarios where our pages can have similar styles for the same element.&lt;/p&gt;

&lt;p&gt;Suppose, within a style sheet we have something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;red&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffff00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;yellow&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;or in two different files we have something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;stylesheet1&lt;/span&gt;&lt;span class="nc"&gt;.css&lt;/span&gt; &lt;span class="nt"&gt;Code&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;red&lt;/span&gt;

&lt;span class="nt"&gt;stylesheet2&lt;/span&gt;&lt;span class="nc"&gt;.css&lt;/span&gt; &lt;span class="nt"&gt;Code&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt;
&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ffff00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;yellow&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;HTML Code:
&lt;span class="nt"&gt;&amp;lt;head&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;title&amp;gt;&lt;/span&gt;CSS for Developers&lt;span class="nt"&gt;&amp;lt;/title&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet1.css"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt;  &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;link&lt;/span&gt; &lt;span class="na"&gt;rel=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet"&lt;/span&gt; &lt;span class="na"&gt;href=&lt;/span&gt;&lt;span class="s"&gt;"stylesheet2.css"&lt;/span&gt; &lt;span class="na"&gt;type=&lt;/span&gt;&lt;span class="s"&gt;"text/css"&lt;/span&gt;  &lt;span class="nt"&gt;/&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/head&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;DID YOU TRIED!!&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;In above shown example, both the times, the style with background-color: #ffff00 wins.&lt;/p&gt;

&lt;p&gt;🔺 &lt;strong&gt;So, our Second rule is:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;This rule is very specific to element when we have exact same style rule coming from different sources. Like the example, we have taken&lt;/strong&gt;: Be very careful here! Next we will check Specificity, that will handle those scenarios in which we don't have same rule on the element.&lt;/p&gt;


&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-&amp;gt; Whatever be the last style, it will win. 
&lt;/span&gt;&lt;span class="p"&gt;So, in both the scenarios, background-color: #ffff00 will load 
&lt;/span&gt;&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;The example with which we have started will need some more knowledge of rules. So, let's start with &lt;strong&gt;&lt;em&gt;Specificity&lt;/em&gt;&lt;/strong&gt; &lt;/p&gt;

&lt;h2&gt;
  
  
  Rules for Author defined style sheets:
&lt;/h2&gt;

&lt;h4&gt;
  
  
  PART-2: Different style is applied through multiple resources on the same element. &lt;strong&gt;&lt;em&gt;Specificity&lt;/em&gt;&lt;/strong&gt;
&lt;/h4&gt;

&lt;p&gt;Great! till now, we have learned two cascading  rules. Now, let's dive deeper.&lt;/p&gt;

&lt;p&gt;In last rule that we have learned, we have identified that if the same styles are applied to an element from multiple sources, we prefer the one which loads at the last.&lt;/p&gt;

&lt;p&gt;But what will happen when styles are different on the same element? Like the scenario, we have have picked in start. &lt;strong&gt;(please refer: TRY IT YOURSELF 1)&lt;/strong&gt; &lt;/p&gt;

&lt;p&gt;If we observe, there are three different styles,&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;One style says, apply yellow color to all those "p" tags which are inside div tag.&lt;/li&gt;
&lt;li&gt;One style says, apply red to all the "p" tags.&lt;/li&gt;
&lt;li&gt;Third style says, apply orange to all the divs which has class abc-myclass.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ How does this work, it will not follow rule 2, as we have different styles on the same element. The browser provides some specificity degree to all the styles and then applies that has highest specificity. We can think of specificity as degree of weightage.&lt;br&gt;&lt;br&gt;
Specificity is more of logical unit of how specific our styles are for some particular element. I would suggest you to read both logical and Theoretical concepts and understand logically instead of learning any formulas or tricks.  &lt;/p&gt;
&lt;/blockquote&gt;

&lt;h3&gt;
  
  
  Logical Explanation
&lt;/h3&gt;

&lt;p&gt;Let's pick each of the three rules. &lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;The style with classname (p.abc-myclass) is most specific to the element. It refer to only those &lt;strong&gt;p&lt;/strong&gt; tags which has &lt;strong&gt;abc-myclass&lt;/strong&gt; class.&lt;/li&gt;
&lt;li&gt;The style with just p tag is generalized and applies to all the p tags. and&lt;/li&gt;
&lt;li&gt; Same is the case with under tag style. (div p) style is more specific then normal "p" tag but less specific then (p.abc-myclass) style.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;

&lt;pre class="highlight diff"&gt;&lt;code&gt;&lt;span class="gd"&gt;-&amp;gt; So, we just have to observe which style is {MOST} specific to an element. 
&lt;/span&gt; In our case, p.abc-myclass is most specific to the element.
&lt;/code&gt;&lt;/pre&gt;

&lt;/blockquote&gt;

&lt;p&gt;This is a high level understanding of how specific the css rule is. let's dive more deeper. &lt;/p&gt;

&lt;h3&gt;
  
  
  Theoretical  Explanation
&lt;/h3&gt;

&lt;p&gt;&lt;strong&gt;Specificity is more of logical unit. How specific our styles are for some particular element.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Let's consider it as a weightage that we will give to our styles for that element. This weightage is a number which has 3 digits. &lt;/p&gt;

&lt;p&gt;This weight could be anything like: 100, 010, 001 etc. So, we can consider them as three digit number that can be represented as &lt;strong&gt;ABC.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;Now, how we will give this weight to our styles. To give weight to our styles. Let's see how each digit of the weight is defined. &lt;/p&gt;

&lt;p&gt;As discussed, weights could be 100. 010, etc. So, we can define it as &lt;strong&gt;ABC.&lt;/strong&gt; Any number can be divided into ones, tens and hundreds place values. Let's see, which type of selector(selectors like: class, id, element or type selectors), fall in each category. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;If you just want to revise your concept of types of selectors or pseudo-class, please refer selectors section of this article:  (&lt;a href="https://dev.to/kushalseth/css-for-developers-5g9j"&gt;Types of CSS selectors&lt;/a&gt;)&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;C (unit place of number):&lt;/strong&gt; 
So the unit digit of the weight can be given to &lt;strong&gt;count of type selectors and universal selectors&lt;/strong&gt;.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;I am adding universal selectors here because they have no impact on Specificity. &lt;/p&gt;

&lt;p&gt;So, if we have css something like these then there specificity would impact the unit place of number.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;   &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;001&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;000&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;universal&lt;/span&gt; &lt;span class="nt"&gt;selector&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;001&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;001&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;all&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt; &lt;span class="nt"&gt;and&lt;/span&gt; &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; &lt;span class="nt"&gt;since&lt;/span&gt; &lt;span class="nt"&gt;this&lt;/span&gt; &lt;span class="nt"&gt;is&lt;/span&gt; &lt;span class="nt"&gt;similar&lt;/span&gt; &lt;span class="nt"&gt;to&lt;/span&gt; &lt;span class="nt"&gt;applying&lt;/span&gt; &lt;span class="nt"&gt;color&lt;/span&gt; &lt;span class="nt"&gt;to&lt;/span&gt; &lt;span class="nt"&gt;individual&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; &lt;span class="nt"&gt;If&lt;/span&gt; &lt;span class="nt"&gt;you&lt;/span&gt; &lt;span class="nt"&gt;get&lt;/span&gt; &lt;span class="nt"&gt;confused&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;just&lt;/span&gt; &lt;span class="nt"&gt;forget&lt;/span&gt; &lt;span class="nt"&gt;this&lt;/span&gt; &lt;span class="nt"&gt;example&lt;/span&gt; &lt;span class="nt"&gt;as&lt;/span&gt; &lt;span class="nt"&gt;of&lt;/span&gt; &lt;span class="nt"&gt;now&lt;/span&gt;&lt;span class="o"&gt;.&lt;/span&gt; 
   &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;002&lt;/span&gt;  &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="nt"&gt;tags&lt;/span&gt; &lt;span class="nt"&gt;inside&lt;/span&gt; &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;tag&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;2&lt;/span&gt; &lt;span class="nt"&gt;tags&lt;/span&gt; &lt;span class="nt"&gt;considered&lt;/span&gt; &lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;B (tens place of number):&lt;/strong&gt;
Tens place can be given to &lt;strong&gt;count of class and attribute selectors&lt;/strong&gt;.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;   &lt;span class="nc"&gt;.nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;010&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;010&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;attribute&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Let's see some examples of &lt;strong&gt;BC&lt;/strong&gt; combined:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;   &lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="nc"&gt;.nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;011&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;011&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;pseudo-class&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
   &lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;011&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;attribute&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;A (hundreds place of number):&lt;/strong&gt;
Hundreds place can be given to &lt;strong&gt;count of id selectors.&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;   &lt;span class="nf"&gt;#nav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;red&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;100&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Combined examples of &lt;strong&gt;ABC&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;   &lt;span class="nf"&gt;#nav&lt;/span&gt; &lt;span class="nt"&gt;li&lt;/span&gt;&lt;span class="nc"&gt;.myclass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;111&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;id&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;element&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h4&gt;
  
  
  Exceptions in Specificity (Extending ABC to YZABC):
&lt;/h4&gt;

&lt;p&gt;The ABC rule holds good in all the scenarios. except inline and !important styles.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Z (Thousands place of number): inline styles:&lt;/strong&gt; It will be at higher priority then above &lt;strong&gt;ABC&lt;/strong&gt; rule, So, if there is any inline style then the specificity will be: 01000
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;  &lt;span class="nt"&gt;style&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"color:blue;"&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;01000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;Y (Ten thousands place of number):&lt;/strong&gt; when you have important in any style sheet:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;  &lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt; &lt;span class="cp"&gt;!important&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;10000&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;I guess, after analyzing so many examples, we have some basic understanding of what is specificity. &lt;strong&gt;There is a lovely graphical representation by @estellevw for specificity:&lt;/strong&gt; &lt;a href="https://specifishity.com" rel="noopener noreferrer"&gt;graphical representation for specificity&lt;/a&gt;&lt;/p&gt;

&lt;p&gt;Let's check specificity in our example:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt;  &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ffff00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;yellow&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;002&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;2&lt;/span&gt; &lt;span class="nt"&gt;elements&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;red&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;001&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;elements&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nc"&gt;.abc-myclass&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="no"&gt;orange&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="p"&gt;}&lt;/span&gt; &lt;span class="o"&gt;//&lt;/span&gt; &lt;span class="nt"&gt;Specificity&lt;/span&gt;&lt;span class="o"&gt;:&lt;/span&gt; &lt;span class="err"&gt;011&lt;/span&gt; &lt;span class="o"&gt;(&lt;/span&gt;&lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="err"&gt;1&lt;/span&gt; &lt;span class="nt"&gt;elements&lt;/span&gt;&lt;span class="o"&gt;)&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;🔺 &lt;strong&gt;So, our Third rule is:&lt;/strong&gt;&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Remember, higher the specificity, that style will be applied to the element.&lt;/strong&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Inheritance
&lt;/h2&gt;

&lt;p&gt;If we check our HTML code, then each element is inherited from the parent element. In our example, p tag is child of div and another p tag is child of body. So, basically, all the elements holds a child-parent relationship in DOM (Document object model).&lt;/p&gt;

&lt;p&gt;There are some properties that we can set in parent that can be inherited to the child. &lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;The sample HTML that we will be using is at this &lt;a href="https://gist.github.com/kushalseth/b0ba8d6aa21b28def616d393af41e9ad" rel="noopener noreferrer"&gt;GIST Link&lt;/a&gt;: You can copy the code from here on paste to any online editor like repl.it&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;I am h2 directly under div&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt;  &lt;span class="na"&gt;data-test=&lt;/span&gt;&lt;span class="s"&gt;"001"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is para inside div, but not directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt;  &lt;span class="na"&gt;class=&lt;/span&gt;&lt;span class="s"&gt;"myclass"&lt;/span&gt;  &lt;span class="na"&gt;data-test=&lt;/span&gt;&lt;span class="s"&gt;"001"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;I am paragraph directly inside the body and below a div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ffff00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;yellow&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;The above code will make this section as yellow: So, p has inherited the back-ground-color property of div tag.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;// This section will be yellow 
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;I am h2 directly under div&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&lt;/span&gt;  &lt;span class="na"&gt;data-test=&lt;/span&gt;&lt;span class="s"&gt;"001"&lt;/span&gt;&lt;span class="nt"&gt;&amp;gt;&lt;/span&gt;This is para inside div, but not directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We can override the inherited values by applying explicit css to the inherited element. Something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ffff00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;yellow&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
   &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;red&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;Output this time:&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%2Fuser-images.githubusercontent.com%2F10295411%2F90815691-b6aa8380-e348-11ea-95cc-d2c62482b3c9.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%2Fuser-images.githubusercontent.com%2F10295411%2F90815691-b6aa8380-e348-11ea-95cc-d2c62482b3c9.png" alt="Output"&gt;&lt;/a&gt;&lt;/p&gt;

&lt;h2&gt;
  
  
  What's Next
&lt;/h2&gt;

&lt;p&gt;It's too much information in this part-2. Let's start fresh in next part-3 about CSS Box Model.&lt;/p&gt;

&lt;p&gt;Where we will check how margins, borders and padding works for DOM.&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;Stay Connected and Stay Save.&lt;/strong&gt; &lt;/p&gt;

</description>
      <category>css</category>
      <category>cssfordevelopers</category>
      <category>100daysofcss</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>[Part - 2: Array] Questions on Array </title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Tue, 11 Aug 2020 18:56:38 +0000</pubDate>
      <link>https://forem.com/kushalseth/part-2-array-questions-on-array-1hnj</link>
      <guid>https://forem.com/kushalseth/part-2-array-questions-on-array-1hnj</guid>
      <description>&lt;h1&gt;
  
  
  Questions on Array 📘
&lt;/h1&gt;

&lt;h4&gt;
  
  
  Check my &lt;a href="https://dev.to/kushalseth/part-3-data-structures-and-algorithms-arrays-3cji"&gt;part 1&lt;/a&gt; for details on the time complexity in Array Operations
&lt;/h4&gt;

&lt;p&gt;Let's discuss some important questions on array. Common questions to practice. I will be using C# as of now for the questions, but really when it comes to logical questions, language really doesn't holds any importance.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ I would suggest, you should try along with me. You can use repl.it and select the language of your choice. Just copy paste the functional methods in the class and use it. Also, you can check my git for more such questions. &lt;a href="https://github.com/kushalseth/DataStructure"&gt;GitHub repository&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;p&gt;Will keep on adding questions daily in the same article.&lt;/p&gt;

&lt;h2&gt;
  
  
  Is array sorted
&lt;/h2&gt;

&lt;p&gt;Checkout if the given array is sorted. The time complexity is Big O(n). You can paste this function in the default c# template in repl. or use this to directly. &lt;a href="https://gist.github.com/kushalseth/643c4ee6a2566ec251b780e9d81b728e"&gt;Gist Link&lt;/a&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="nf"&gt;IsArraySorted&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
&lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;bool&lt;/span&gt; &lt;span class="n"&gt;isSorted&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
    &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(!(&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]))&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;isSorted&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;false&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
        &lt;span class="k"&gt;else&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="n"&gt;isSorted&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;

    &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;||&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="n"&gt;isSorted&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;true&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;isSorted&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Reverse the array
&lt;/h2&gt;

&lt;p&gt;Reversing an array is like you want first event to be the last element and second element as the last - 1 element. The time complexity of problem is O(n)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="nf"&gt;ReversedArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;.&lt;/span&gt;&lt;span class="n"&gt;Length&lt;/span&gt; &lt;span class="p"&gt;/&lt;/span&gt; &lt;span class="m"&gt;2&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;--)&lt;/span&gt;
            &lt;span class="p"&gt;{&lt;/span&gt;
                &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;++;&lt;/span&gt;
                &lt;span class="kt"&gt;var&lt;/span&gt; &lt;span class="n"&gt;temp&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
                &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
                &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;temp&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="p"&gt;}&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;array&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  Remove duplicates from Array
&lt;/h2&gt;

&lt;p&gt;Removing duplicates from an array comes up with a tricky part. &lt;strong&gt;Try it yourself&lt;/strong&gt; and explore. Time complexity is O(1)&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;        &lt;span class="k"&gt;public&lt;/span&gt; &lt;span class="k"&gt;static&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;RemoveDuplicatesFromSortedArray&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arrayLength&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt; &lt;span class="p"&gt;||&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
                &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

            &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
            &lt;span class="k"&gt;for&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;arrayLength&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt;
                &lt;span class="k"&gt;if&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;!=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;])&lt;/span&gt;
                    &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;++]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;

            &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;++]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;arrayLength&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;k&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



</description>
      <category>algorithms</category>
      <category>datastructure</category>
      <category>codenewbie</category>
      <category>100daysofcode</category>
    </item>
    <item>
      <title>[1] CSS Basics #CSSForDevelopers</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Sat, 01 Aug 2020 18:45:51 +0000</pubDate>
      <link>https://forem.com/kushalseth/css-for-developers-5g9j</link>
      <guid>https://forem.com/kushalseth/css-for-developers-5g9j</guid>
      <description>&lt;h1&gt;
  
  
  CSS for Developers 🦄
&lt;/h1&gt;

&lt;p&gt;CSS is really important if you are trying to be a full stack developer.  &lt;/p&gt;

&lt;p&gt;Being a full stack developer, you should be able to handle complete application on your own from design -&amp;gt; develop -&amp;gt; automate to  deploy. &lt;/p&gt;

&lt;p&gt;Let's start the journey. Stay with me during the article, I will be covering most of the important CSS topics to get started.   &lt;/p&gt;

&lt;p&gt;If you are a developer and wondering from where to start learning CSS, then you can follow this series and you will surely get everything from basics to designing a component. &lt;/p&gt;

&lt;h1&gt;
  
  
  Why CSS
&lt;/h1&gt;

&lt;p&gt;Yes you are correct, to separate the representational logic from the markup. CSS is a language that helps you to give design to your pages. CSS provides flexibility of any future design changes, otherwise we have to always update mark-up(HTML).     &lt;/p&gt;

&lt;h2&gt;
  
  
  Exploring basics of CSS
&lt;/h2&gt;

&lt;p&gt;Now, we have to add CSS to our project. I would suggest, not to use inline CSS or any inline styles as that makes the code dirty and you will really have hard time in future when your project expands. Also, you will not have a global implementation for your CSS rules.&lt;/p&gt;

&lt;p&gt;Use CSS as external file link, something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;&amp;lt;&lt;/span&gt;&lt;span class="nt"&gt;link&lt;/span&gt; &lt;span class="nt"&gt;rel&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"stylesheet"&lt;/span&gt; &lt;span class="nt"&gt;href&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"./index.css"&lt;/span&gt; &lt;span class="nt"&gt;type&lt;/span&gt;&lt;span class="o"&gt;=&lt;/span&gt;&lt;span class="s1"&gt;"text/css"&lt;/span&gt;  &lt;span class="o"&gt;/&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;A CSS can be written something like this:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;body&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This is the typical structure of writing CSS. What we are doing is applying background color to the body. So this has two parts&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Selectors:&lt;/strong&gt; "body" is a selector here. Selector is used to apply styles to the elements. We have multiple selectors. &lt;br&gt;
Some simple selectors are:&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Type selector:&lt;/strong&gt; body is is tag, where we are applying design to a particular tag. These are type selectors.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Id selector:&lt;/strong&gt; Which will apply designs to the Id of element on the page.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nf"&gt;#parent&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Class Selector:&lt;/strong&gt; It identifies the classes with the same name and apply the designs to all the elements having that class.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nc"&gt;.childnav&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Universal selector:&lt;/strong&gt; asterisk is a universal selector, where we are applying design to all the tags. These are universal selectors.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="o"&gt;*&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;li&gt;
&lt;p&gt;&lt;strong&gt;Attribute selector:&lt;/strong&gt; matches value of in given selector. Like this will apply color to all a tags which has title.&lt;br&gt;
&lt;/p&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;title&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
     &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/li&gt;
&lt;/ul&gt;


&lt;/li&gt;
&lt;li&gt;&lt;p&gt;&lt;strong&gt;Key Value pairs:&lt;/strong&gt; "background-color" is key and we are setting the value as "#ff0000".  &lt;/p&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;We have selectors like body, and key value properties. &lt;strong&gt;Selectors tells the browser where to apply the style.&lt;/strong&gt;&lt;/p&gt;

&lt;p&gt;&lt;strong&gt;What are Pseudo-classes?&lt;/strong&gt; Pseudo classes are applied to the element based on some external factors like when a user mouse hover, we want some text color change.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;blue&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;You can learn about more pseudo-class here: &lt;a href="https://developer.mozilla.org/en-US/docs/Web/CSS/Pseudo-classes"&gt;standard pseudo-classes&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  Grouping multiple selectors
&lt;/h2&gt;

&lt;p&gt;We can group multiple selectors as well. We all have seen them. So, let's see some examples:&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;The sample HTML that we will be using is: You can copy paste the code from here:&lt;/strong&gt; &lt;a href="https://gist.github.com/kushalseth/6ecc3a0d295e93d2c2796585ad46a458"&gt;GIST Link&lt;/a&gt; . Please, copy paste the gist code in any online editor. You can use repl.it as well. You can replace the code of style with the given style in each point and play with it. This will help to understand with live examples.&lt;br&gt;
&lt;/p&gt;
&lt;/blockquote&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;body&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;h1&amp;gt;&lt;/span&gt;This is h1 directly under body&lt;span class="nt"&gt;&amp;lt;/h1&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;I am h2 directly under div&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
      &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside div, but not directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;  
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
         &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
         &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside span&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I am paragraph directly inside the body and below a div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/body&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Let's take two tag selectors separated by &lt;strong&gt;commas&lt;/strong&gt;. This can be class or id selector as well. So, what we are doing in this example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;    &lt;span class="nt"&gt;div&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;We are actually trying to set background color to all the div tags on the page and same is the case with p. These sections will be yellow in color:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;h2&amp;gt;&lt;/span&gt;I am h2 directly under div&lt;span class="nt"&gt;&amp;lt;/h2&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside div, but not directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
        &lt;span class="nt"&gt;&amp;lt;span&amp;gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside span&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&amp;lt;/span&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I am paragraph directly inside the body and below a div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;element inside an element&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;    &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give #ff0000 background to all the p inside div tag. &lt;strong&gt;p&lt;/strong&gt; tag should be inside &lt;strong&gt;div&lt;/strong&gt;, irrespective of they are nested inside any other tag. These lines will be yellow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside div, but not directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside span&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;greater than sign between elements&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;    &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="o"&gt;&amp;gt;&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give #ff0000 background to all the p tags whose parent is a div tag. &lt;strong&gt;p&lt;/strong&gt; should have &lt;strong&gt;div&lt;/strong&gt; as parent, If you observe, there is a difference between what we are seeing in above example and this example. These lines will be yellow:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt; &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para inside div, but not directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
 &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;This is para directly inside div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;plus sign between elements&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;    &lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="o"&gt;+&lt;/span&gt; &lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give #ff0000 background to all the p which are placed immediately after div tag. These lines will be yellow in color.&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt;I am paragraph directly inside the body and below a div&lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;blockquote&gt;
&lt;p&gt;⚠️ &lt;strong&gt;Please use this GIST for below examples:&lt;/strong&gt; &lt;a href="https://gist.github.com/kushalseth/b0f9ad81c62c56573a810c1056ff0110"&gt;GIST for below examples&lt;/a&gt;. Please, copy paste the gist code in any online editor. You can use repl.it as well. You can replace the code of style with the given style in each point and play with it.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;element with dot and class name&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;    &lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nc"&gt;.myclass&lt;/span&gt;&lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give #ff0000 background to all the p which have class myclass.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;attributes selector&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;data-test&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ffff00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;yellow&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;

&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;target&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#ffa500&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;orange&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;p[data-test] will give #ffff00 background to all the p which have custom attribute as data-test. and a[target] will give orange color to all the a elements which have target.&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;attributes selector advanced&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="nt"&gt;class&lt;/span&gt;&lt;span class="o"&gt;*=&lt;/span&gt;&lt;span class="s1"&gt;"-myclass"&lt;/span&gt;&lt;span class="o"&gt;]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt;  &lt;span class="m"&gt;#008000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;green&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;This will give green color to all the p elements which has class like "-myclass"&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;::after and ::before&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;p&lt;/span&gt;&lt;span class="nd"&gt;::after&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
  &lt;span class="nl"&gt;content&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="s1"&gt;" - add content"&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;::after&lt;/strong&gt; Insert something after the content of each &lt;strong&gt;p&lt;/strong&gt; element. and &lt;strong&gt;::before&lt;/strong&gt; will add before the element&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;
&lt;strong&gt;:hover&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;a&lt;/span&gt;&lt;span class="nd"&gt;:hover&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
  &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="no"&gt;yellow&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;:hover&lt;/strong&gt; Insert something on move hover.&lt;/p&gt;

&lt;blockquote&gt;
&lt;p&gt;These are some of the common selectors, you can find more at &lt;a href="https://www.w3.org/TR/selectors-3/"&gt;https://www.w3.org/TR/selectors-3/&lt;/a&gt; and a good handy list is available here as well: &lt;a href="https://www.w3schools.com/cssref/css_selectors.asp"&gt;https://www.w3schools.com/cssref/css_selectors.asp&lt;/a&gt;&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h2&gt;
  
  
  What is Cascading and when do we need it
&lt;/h2&gt;

&lt;p&gt;So, we have seen, how we can apply styles to different elements. Now, let's discuss a scenario where we have nested tags/classes and there is CSS written for parent as well as child. &lt;/p&gt;

&lt;p&gt;&lt;strong&gt;HTML code snippet&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight html"&gt;&lt;code&gt;&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt; Welcome to CSS learning &lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;div&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt; You are learning CSS for Developers &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
    &lt;span class="nt"&gt;&amp;lt;p&amp;gt;&lt;/span&gt; Let's get started &lt;span class="nt"&gt;&amp;lt;/p&amp;gt;&lt;/span&gt;
&lt;span class="nt"&gt;&amp;lt;/div&amp;gt;&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;CSS code snippet&lt;/strong&gt;&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight css"&gt;&lt;code&gt;&lt;span class="nt"&gt;div&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#ff0000&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;red&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;span class="nt"&gt;p&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="nl"&gt;background-color&lt;/span&gt;&lt;span class="p"&gt;:&lt;/span&gt; &lt;span class="m"&gt;#FFFF00&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="err"&gt;//&lt;/span&gt; &lt;span class="err"&gt;yellow&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;p&gt;&lt;strong&gt;Let's discuss the problem first&lt;/strong&gt;, If you observe, we have given red color to div selector. So, ideally it should apply red color to all the divs, &lt;strong&gt;Try it your self&lt;/strong&gt;.&lt;/p&gt;

&lt;p&gt;Something is wrong, you are not able to see red on both the divs!&lt;/p&gt;

&lt;p&gt;Yes it should not give red to all the divs. This is the scenario for us to explore. Where Cascading will be applied. &lt;strong&gt;We can think of Cascading as applying of CSS rules based on the inheritance.&lt;/strong&gt; We will explore more in next topic.&lt;/p&gt;

&lt;p&gt;I will be publishing how cascading works, how we will implement inheritance, and advance topics of CSS and SASS.&lt;/p&gt;

&lt;p&gt;Stay Connected and Stay Save. &lt;/p&gt;

</description>
      <category>css</category>
      <category>cssfordevelopers</category>
      <category>100daysofcode</category>
      <category>100daysofcss</category>
    </item>
    <item>
      <title>[Part-I: Arrays] Data Structures and Algorithms</title>
      <dc:creator>Kushal</dc:creator>
      <pubDate>Wed, 29 Jul 2020 19:01:25 +0000</pubDate>
      <link>https://forem.com/kushalseth/part-3-data-structures-and-algorithms-arrays-3cji</link>
      <guid>https://forem.com/kushalseth/part-3-data-structures-and-algorithms-arrays-3cji</guid>
      <description>&lt;p&gt;Let's discuss arrays theoretically along with the complexities in Part-I and will solve some Array competitive problems in Part-II. Please stay with me for next 5 minutes. Let's start.&lt;/p&gt;

&lt;h1&gt;
  
  
  Array
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Array is one of the data structure that stores multiple items of same data type at contiguous(next or together in sequence) memory locations. &lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;#important&lt;/strong&gt; This means we can access the element using the index of the array. The advantage of accessing using index and contiguous memory location is the complexity to get the ith index is &lt;strong&gt;Big O(1)&lt;/strong&gt;. Means they find the ith element in constant time. Big O(1), because you can easily get the address of any item using x + iy, where x is the initial memory state, and y is the memory of each item.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;ul&gt;
&lt;li&gt;Array provides Cache friendliness, Cache is the memory closed to CPU, then RAM or any other hard disk memory.&lt;/li&gt;
&lt;/ul&gt;

&lt;blockquote&gt;
&lt;p&gt;&lt;strong&gt;#important&lt;/strong&gt; Due to contiguous memory location, It's more likely that the CPU caches all the contiguous items of Array.&lt;/p&gt;
&lt;/blockquote&gt;

&lt;h1&gt;
  
  
  Memory Allocation
&lt;/h1&gt;

&lt;ul&gt;
&lt;li&gt;Fixed Sized Arrays
In C# or Java, the arrays have &lt;strong&gt;Heap allocated memories&lt;/strong&gt;. while in C/C++, we can have both heap/stack allocated memories.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight java"&gt;&lt;code&gt;&lt;span class="nc"&gt;Java&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="mi"&gt;5&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt;&lt;span class="o"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="o"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array1&lt;/span&gt; &lt;span class="o"&gt;=&lt;/span&gt; &lt;span class="o"&gt;{&lt;/span&gt;&lt;span class="mi"&gt;10&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;20&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;30&lt;/span&gt;&lt;span class="o"&gt;,&lt;/span&gt; &lt;span class="mi"&gt;40&lt;/span&gt;&lt;span class="o"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;





&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array1&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
&lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="n"&gt;array1&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="k"&gt;new&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt;&lt;span class="p"&gt;[]&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;3&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;5&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;7&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="m"&gt;9&lt;/span&gt; &lt;span class="p"&gt;};&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Dynamic Sized Arrays
In dynamic sized array, we can insert as many elements as we want. Whenever the capacity is exhausted for an array and we try to insert something the size of array automatically increases.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Example of dynamic sized arrays:&lt;br&gt;
&lt;/p&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="p"&gt;++&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;vectors&lt;/span&gt;
&lt;span class="n"&gt;Java&lt;/span&gt; &lt;span class="n"&gt;and&lt;/span&gt; &lt;span class="n"&gt;C&lt;/span&gt;&lt;span class="err"&gt;#&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;ArrayList&lt;/span&gt;
&lt;span class="n"&gt;Python&lt;/span&gt; &lt;span class="p"&gt;-&amp;gt;&lt;/span&gt; &lt;span class="n"&gt;List&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h1&gt;
  
  
  Operations on Array
&lt;/h1&gt;

&lt;h2&gt;
  
  
  1. Search
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;Searching an element in an array is about returning the index of an array. If the element is not found, we returns -1.&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;&lt;em&gt;Example of Linear Search&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We have to search the first index of the given index.&lt;/li&gt;
&lt;li&gt;Linear search is about searching the element in the given array. If the event is not found then we have to traverse the whole array.&lt;/li&gt;
&lt;li&gt;
&lt;strong&gt;The worst case complexity of this is Big O(n)&lt;/strong&gt;. This happens when the element is not found in the array. as the result will be a linear expression always.
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;search&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;elementtosearch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt;&lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;length&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;elementtosearch&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
            &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;Above elements were not sorted. But what happens when the arrays are sorted.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;We can do a search with Big O(log n) for sorted array.&lt;/strong&gt;&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  2. Insert
&lt;/h2&gt;

&lt;p&gt;&lt;em&gt;Insertion in Fixed Size Arrays&lt;/em&gt;&lt;/p&gt;

&lt;ul&gt;
&lt;li&gt;We cannot insert in fixed fixed array if it is already full. So, we can insert an element at a position only when it has some empty space.&lt;/li&gt;
&lt;li&gt;When we insert, we return the size of the updated array. If the size and capacity of the array is same, we will not increase the size of array and will directly returns the current size of array.&lt;/li&gt;
&lt;li&gt;&lt;strong&gt;Time complexity of Insert operation: worst case Big O(n)&lt;/strong&gt;&lt;/li&gt;
&lt;li&gt;example:
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="n"&gt;function&lt;/span&gt; &lt;span class="nf"&gt;insertion&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;currentSizeOfArray&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;elementtoinsert&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;position&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;currentSizeOfArray&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;capacity&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt;
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;currentSizeOfArray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;

    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;indexToInsertAt&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;position&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="c1"&gt;// as position starts from 1 and index starts from 0&lt;/span&gt;

    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;currentSizeOfArray&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;gt;=&lt;/span&gt; &lt;span class="n"&gt;indexToInsertAt&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;indexToInsertAt&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;elementtoinsert&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;currentSizeOfArray&lt;/span&gt; &lt;span class="p"&gt;+&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt;
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;ul&gt;
&lt;li&gt;&lt;em&gt;Insertion in Dynamic Size Arrays&lt;/em&gt;&lt;/li&gt;
&lt;li&gt;Dynamic size array doubles it's size when they are full and releases their existing memory.&lt;/li&gt;
&lt;li&gt;This is the most costly step when you are using dynamic sized error. Need to be avoided in production environments.&lt;/li&gt;
&lt;li&gt;add operation in arraylist of java and c#.&lt;/li&gt;
&lt;/ul&gt;

&lt;h2&gt;
  
  
  3. Delete
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;When we delete an array, we want to remove the element from the array, reduce the current size of array, but capacity remains same for array. Also, the elements should move one position ahead.
i &lt;strong&gt;Time complexity of delete is Big O(n)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;div class="highlight js-code-highlight"&gt;
&lt;pre class="highlight csharp"&gt;&lt;code&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="nf"&gt;deleteElement&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[],&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;sizeOfArray&lt;/span&gt;&lt;span class="p"&gt;,&lt;/span&gt; &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;elementToDelete&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
    &lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="c1"&gt;// searching element in array&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="m"&gt;0&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;sizeOfArray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;elementToDelete&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
            &lt;span class="k"&gt;break&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
        &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="c1"&gt;// element is not present in array&lt;/span&gt;
    &lt;span class="k"&gt;if&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;i&lt;/span&gt; &lt;span class="p"&gt;==&lt;/span&gt; &lt;span class="n"&gt;sizeOfArray&lt;/span&gt;&lt;span class="p"&gt;)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt; 
        &lt;span class="k"&gt;return&lt;/span&gt; &lt;span class="n"&gt;sizeOfArray&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="k"&gt;for&lt;/span&gt;&lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="kt"&gt;int&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;i&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt; &lt;span class="p"&gt;&amp;lt;&lt;/span&gt; &lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt; &lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;;&lt;/span&gt; &lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;++)&lt;/span&gt; &lt;span class="p"&gt;{&lt;/span&gt;
        &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;]&lt;/span&gt; &lt;span class="p"&gt;=&lt;/span&gt; &lt;span class="n"&gt;arr&lt;/span&gt;&lt;span class="p"&gt;[&lt;/span&gt;&lt;span class="n"&gt;j&lt;/span&gt;&lt;span class="p"&gt;+&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;];&lt;/span&gt;
    &lt;span class="p"&gt;}&lt;/span&gt;
    &lt;span class="nf"&gt;retun&lt;/span&gt; &lt;span class="p"&gt;(&lt;/span&gt;&lt;span class="n"&gt;n&lt;/span&gt; &lt;span class="p"&gt;-&lt;/span&gt;&lt;span class="m"&gt;1&lt;/span&gt;&lt;span class="p"&gt;);&lt;/span&gt;
&lt;span class="p"&gt;}&lt;/span&gt; 
&lt;/code&gt;&lt;/pre&gt;

&lt;/div&gt;



&lt;h2&gt;
  
  
  4. Get and Update
&lt;/h2&gt;

&lt;ul&gt;
&lt;li&gt;We can directly get or update the element in an array with &lt;strong&gt;Big O (1)&lt;/strong&gt;
&lt;/li&gt;
&lt;/ul&gt;

&lt;p&gt;Stay tuned for part-II, where we will solve multiple array problems. and then later in the series, I will be working on multiple Data Structures. Stay Connected!! Stay Safe!!  &lt;/p&gt;

</description>
      <category>algorithms</category>
      <category>arrays</category>
      <category>datastructure</category>
      <category>codenewbie</category>
    </item>
  </channel>
</rss>
