<?xml version="1.0" encoding="UTF-8"?><rss xmlns:dc="http://purl.org/dc/elements/1.1/" xmlns:content="http://purl.org/rss/1.0/modules/content/" xmlns:atom="http://www.w3.org/2005/Atom" version="2.0" xmlns:cc="http://cyber.law.harvard.edu/rss/creativeCommonsRssModule.html">
    <channel>
        <title><![CDATA[TechSoftware - Medium]]></title>
        <description><![CDATA[Bite-sized knowledge on Software Concepts, New &amp; Trending Technologies - Medium]]></description>
        <link>https://medium.com/techsoftware?source=rss----7614c2ea6c33---4</link>
        <image>
            <url>https://cdn-images-1.medium.com/proxy/1*TGH72Nnw24QL3iV9IOm4VA.png</url>
            <title>TechSoftware - Medium</title>
            <link>https://medium.com/techsoftware?source=rss----7614c2ea6c33---4</link>
        </image>
        <generator>Medium</generator>
        <lastBuildDate>Mon, 30 Nov 2026 23:08:58 GMT</lastBuildDate>
        <atom:link href="https://medium.com/feed/techsoftware" rel="self" type="application/rss+xml"/>
        <webMaster><![CDATA[yourfriends@medium.com]]></webMaster>
        <atom:link href="http://medium.superfeedr.com/" rel="hub"/>
        <item>
            <title><![CDATA[DIGITS: NVIDIA’s Personal AI Supercomputer]]></title>
            <link>https://medium.com/techsoftware/digits-nvidias-personal-ai-supercomputer-6215fb15c82c?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/6215fb15c82c</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[artificial-intelligence]]></category>
            <category><![CDATA[ai]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Fri, 10 Jan 2025 07:28:00 GMT</pubDate>
            <atom:updated>2025-01-10T07:11:21.172Z</atom:updated>
            <content:encoded><![CDATA[<p>In a world where artificial intelligence is rapidly becoming part of everyday life, NVIDIA has once again taken center stage with an exciting new development: <strong>Project DIGITS</strong>. Announced at CES 2025 by CEO Jensen Huang, DIGITS aims to give creators, developers, and enthusiasts a compact AI supercomputer that’s as user-friendly as it is powerful. Here’s everything we know from the official sources and how it could revolutionize personal AI computing.</p><p><em>Disclaimer: This story was written with the assistance of an AI writing program called </em><a href="https://chatgpt.com/"><strong><em>ChatGPT</em></strong></a><em>.</em></p><h3>What Is DIGITS?</h3><p>According to <strong>NVIDIA CEO Jensen Huang’s Keynote at CES 2025</strong> (see transcript below), DIGITS is the culmination of over a decade of research that began as “Project DIGITS” but later evolved into the “DGX” series for enterprise AI computing. Now, NVIDIA is returning to its roots by unveiling a personal AI supercomputer that runs the entire NVIDIA AI stack, offering:</p><ol><li><strong>Compact Design</strong>: Smaller and more accessible than ever before.</li><li><strong>Cutting-Edge Hardware</strong>: Powered by the <strong>GB110</strong> chip — NVIDIA’s smallest “Grace Blackwell” GPU — paired with a custom CPU built in collaboration with Mediatek.</li><li><strong>Plug-and-Play AI</strong>: Designed to be used as a “cloud supercomputer” on your desk or as a local Linux workstation for AI tasks.</li><li><strong>Seamless Integration</strong>: Supporting NVIDIA’s full suite of AI frameworks and capable of linking multiple units for larger workloads.</li></ol><h3>Key Takeaways from Jensen Huang’s Keynote</h3><p>In Huang’s words, <strong>“Everybody who uses computers today as a tool will need an AI supercomputer.”</strong> This underscores the vision behind DIGITS: AI should be as commonplace in the professional landscape as a laptop or smartphone. Previously, AI supercomputers like DGX-1 were large and out of reach for smaller teams and individual creators. With DIGITS, you can:</p><ul><li><strong>Unbox and Deploy</strong>: No need to build a specialized facility or tinker with complicated infrastructure.</li><li><strong>Scale Up</strong>: Connect multiple DIGITS units using high-speed networking technology such as ConnectX and GPUDirect.</li><li><strong>Stay Versatile</strong>: Whether you’re using a PC, Mac, or any other platform, DIGITS can be accessed wirelessly or through a workstation configuration.</li></ul><blockquote>“This is the new way of doing software,” Huang emphasized, reminding the audience how AI and deep learning are reshaping software development across industries.</blockquote><h4>Why It Matters</h4><ol><li><strong>Democratizing AI</strong>: DIGITS could empower entrepreneurs, small research labs, and even hobbyists with supercomputer-level horsepower in a user-friendly package.</li><li><strong>Ecosystem Compatibility</strong>: Because it integrates seamlessly with NVIDIA’s AI tools and cloud services, you can leverage existing deep learning frameworks like TensorFlow, PyTorch, and more.</li><li><strong>Future-Proof</strong>: As AI technologies and workloads expand, the modular nature of DIGITS (plus the ability to combine multiple units) means you won’t be left behind.</li></ol><h3>Official Images and Sneak Peeks</h3><p>Below are some official visuals provided directly by NVIDIA’s YouTube channel and website:</p><p><strong>Screenshot</strong>: DIGITS screenshot from NVIDIA’s official teaser video<br><em>Source: </em><a href="https://youtu.be/kZRMshaNrSA?si=8sdG7s0v0hHe7Dpu"><strong><em>NVIDIA YouTube channel</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*uPlmAL7KyWa9rQZe.png" /></figure><p><strong>Photo</strong>: An exploded view of Project DIGITS<br><em>Source: </em><a href="https://www.nvidia.com/en-us/project-digits/"><strong><em>NVIDIA’s website</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*kRwKpmlggxci6LpH.jpeg" /></figure><p><strong>Photo</strong>: DIGITS placed near a desktop<br><em>Source: </em><a href="https://www.nvidia.com/en-us/project-digits/"><strong><em>NVIDIA’s website</em></strong></a></p><figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/0*S0_5coqq8m8FAjAl.jpg" /></figure><p>These images showcase DIGITS’ compact design, modular internal architecture, and how it can be conveniently placed alongside a typical workstation setup.</p><h4>The Road Ahead</h4><p>Huang announced that DIGITS is <strong>“in full production”</strong> and is expected to be available around May. Given NVIDIA’s track record for delivering powerful hardware (as seen with the original DGX-1 that catalyzed AI breakthroughs), the anticipation is high for this more accessible version. If you’re a developer, data scientist, or creative professional who wants a personal AI workhorse, keeping tabs on DIGITS’ release timeline is a must.</p><h4>Full Transcript Reference</h4><p>For those who want the complete context, here’s a snippet from <strong>NVIDIA CEO Jensen Huang’s Keynote at CES 2025</strong> (official NVIDIA YouTube channel):</p><blockquote>“…none of this would be possible if not for this incredible project that we started a decade ago inside the company called Project DIGITS… And now artificial intelligence is everywhere… every software engineer, every creative artist, everybody who uses computers today as a tool, will need an AI supercomputer…”</blockquote><blockquote>“…if you use PC, Mac, you know anything… it’s a cloud computing platform that sits on your desk… you could also use it as a Linux workstation if you like…”</blockquote><blockquote>(For the full transcript, see the original video at <a href="https://www.youtube.com/watch?v=k82RwXqZHY8&amp;t=4897s"><strong>this link</strong></a>.)</blockquote><h4>Final Thoughts</h4><p>DIGITS might just be the device that turns AI from a specialized tool into a universal commodity. Whether you’re a software engineer experimenting with generative AI models or a content creator seeking new ways to generate media (like myself), this personal AI supercomputer promises to harness the power of data and accelerate your workflows.</p><p>If you’ve been waiting for a more compact, ready-to-go AI solution, <strong>Project DIGITS</strong> could be the breakthrough. Stay tuned for further updates as NVIDIA moves closer to the official release. With any luck, we’ll see more “digits” in the hands of developers, researchers, and creatives worldwide — truly bringing AI supercomputing to the masses.</p><h4>Sources Cited</h4><ol><li><strong>Transcript</strong>: <em>NVIDIA CEO Jensen Huang Keynote at CES 2025</em>, Official NVIDIA YouTube Channel (<a href="https://www.youtube.com/watch?v=k82RwXqZHY8&amp;t=4897s"><strong>Watch here</strong></a>)</li><li><strong>Images &amp; Teaser</strong>: Screenshots and photos of Project DIGITS from NVIDIA’s official teaser video and website</li></ol><h4>Who Am I?</h4><ul><li>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications and sharing my knowledge through <a href="https://aswinbarath.me/"><strong>Blogging</strong></a></li><li>Connect with me <a href="https://linktr.ee/AswinBarath"><strong>Socials (Linktree)</strong></a></li></ul><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6215fb15c82c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/digits-nvidias-personal-ai-supercomputer-6215fb15c82c">DIGITS: NVIDIA’s Personal AI Supercomputer</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Two Sum — LeetCode Java Solution]]></title>
            <link>https://medium.com/techsoftware/two-sum-leetcode-java-solution-6318b05452a0?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/6318b05452a0</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[problem-solving]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Mon, 03 Jul 2023 17:21:27 GMT</pubDate>
            <atom:updated>2023-07-15T13:46:32.482Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*Wdqz3B3HITsYuLh11DCFeA.jpeg" /></figure><h3>Two Sum — LeetCode Java Solution</h3><p>Hello readers, let’s solve a LeetCode problem today.</p><p>In this blog, let’s solve <a href="https://leetcode.com/problems/two-sum/description/">Two Sum</a> which is one of the <a href="https://leetcode.com/discuss/interview-question/460599/Blind-75-LeetCode-Questions">Blind 75 List of LeetCode Problems</a>.</p><p>The Two Sum problem is a classic coding challenge and the №1 problem on LeetCode, that asks us to find two numbers in an array that add up to a given target.</p><p>In this blog post, we will explore two different approaches to solving this problem: the Brute Force approach and the Optimal approach. We will examine the problem statement, understand the test cases, and dive into the code implementations for both approaches. Additionally, we will analyze the time and space complexities of each solution.</p><p><strong>Understanding the Problem:</strong></p><ul><li>Given an array of integers <strong>nums</strong> and a target integer <strong>target</strong>, the task is to find two numbers in the array such that their sum equals the target.</li><li>Our objective is to return the indices of these two numbers.</li><li>The problem also mentions that each input will have <strong><em>exactly</em> one solution</strong>, and you cannot use the <em>same</em> element twice.</li></ul><p><strong>Understanding the Test Cases:</strong></p><p>To better understand the problem, let’s consider a few simple test cases:</p><p><strong>Test Case 1:</strong></p><pre>Input: nums = [2, 7, 11, 15], target = 9<br>Output: [0, 1]</pre><p>Explanation: The sum of the numbers at indices 0 and 1 is equal to the target value of 9.</p><p><strong>Test Case 2:</strong></p><pre>Input: nums = [3, 2, 4], target = 6<br>Output: [1, 2]</pre><p>Explanation: The sum of the numbers at indices 1 and 2 is equal to the target value of 6.</p><p><strong>Test Case 3:</strong></p><pre>Input: nums = [3, 3], target = 6<br>Output: [0, 1]</pre><p>Explanation: The sum of the numbers at indices 0 and 1 is equal to the target value of 6.</p><h4><strong>Brute Force Approach: Nested Loops</strong></h4><pre>class Solution {<br>    public int[] twoSum(int[] nums, int target) {<br>        int[] result = new int[2];<br>        for(int i=0; i&lt;nums.length; i++) {<br>            for(int j=i+1; j&lt;nums.length; j++) {<br>                if((nums[i] + nums[j]) == target) {<br>                    result[0] = i;                    <br>                    result[1] = j;                    <br>                    return result;<br>                }<br>            }<br>        }<br>        return result;<br>    }<br>}</pre><p><strong>Key Points:</strong></p><ul><li>We go through each number in the array and add it to every other number to see if their sum equals the target.</li><li>If we find two numbers that add up to the target, we return their indices.</li></ul><p><strong>Time Complexity:</strong> O(N²)</p><ul><li>The brute force approach uses nested loops to check every pair of numbers, resulting in a time complexity of O(N²), where n is the size of the input array.</li></ul><p><strong>Space Complexity:</strong> O(1)</p><ul><li>The space complexity of this approach is O(1) because we only need a fixed-size <strong>result</strong> array to store the indices.</li></ul><h4><strong>Optimal Approach: Hashmap</strong></h4><pre>class Solution {<br>    public int[] twoSum(int[] nums, int target) {<br>        int[] result = new int[2];<br>        HashMap&lt;Integer, Integer&gt; map = new HashMap&lt;&gt;();<br>        for(int i=0; i&lt;nums.length; i++) {<br>            int numberToFind = target - nums[i];<br>            if(map.containsKey(numberToFind)) {<br>                result[0] = map.get(numberToFind); <br>                result[1] = i;<br>            }<br>            map.put(nums[i], i);<br>        }<br>        return result;<br>    }<br>}</pre><p><strong>Key Points:</strong></p><ul><li>For each number in the array, we calculate the difference between the target and that number.</li><li>We check if this difference exists in the HashMap, which means we have found a pair of numbers that add up to the target.</li><li>If we find such a pair, we return their indices.</li><li>Otherwise, we keep adding the numbers and their indices to the HashMap.</li></ul><p><strong>Time Complexity:</strong> O(N)</p><ul><li>The optimal approach has a time complexity of O(N), because we iterate through the input array <strong>nums</strong> only once, and each lookup operation in the HashMap takes constant time.</li></ul><p><strong>Space Complexity:</strong> O(N)</p><ul><li>The space complexity of the optimal approach is O(N) because, in the worst case, we may need to store all the elements of the array in the HashMap.</li></ul><p><strong>Google Engineer — Coding Interview Style — Video Solution</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FXKu_SEDAykw%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DXKu_SEDAykw&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FXKu_SEDAykw%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/98307ea0780c1f8e29bb3c2e0bd7c609/href">https://medium.com/media/98307ea0780c1f8e29bb3c2e0bd7c609/href</a></iframe><p><strong>Also, checkout, NeetCode Video Solution:</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FKLlXCFG5TnA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DKLlXCFG5TnA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2FKLlXCFG5TnA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/c4c42615b5bed59564a06ec8a8649540/href">https://medium.com/media/c4c42615b5bed59564a06ec8a8649540/href</a></iframe><p><strong>Recommended Resources to Learn Data Structures and Algorithms</strong></p><p>Basics of DS Algo Blogs:</p><p>1. <a href="https://medium.com/techsoftware/understanding-hashing-in-java-exploring-hashmap-and-hashset-b2c7d28453c">Hashing in Java</a></p><p>Recommended YouTubers for LeetCode Problems:</p><p>1. <a href="https://www.youtube.com/@NeetCode">NeetCode</a></p><p>2. <a href="https://www.youtube.com/@takeUforward/featured">Take U Forward</a></p><p>Free Resources for Learning Data Structures and Algorithms:</p><p>1. <a href="https://neetcode.io/roadmap?utm_source=aswin">NeetCode Roadmap</a></p><p>2. <a href="https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/">Striver’s SDE Sheet</a></p><p>Recommended Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://neetcode.io/courses?utm_source=aswin">NeetCode Courses</a></li><li>ZTM: Mastering the Coding Interview (Big Tech): Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.3919716491451706865583445&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-big-tech-faang-interviews%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_rml6679s/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li>ZTM: Mastering the Coding Interview: Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391976131953022569348758&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-data-structures-algorithms%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_nqb6sg6w/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li><a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391975289945963380819471&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fcpp-data-structures-algorithms-levelup-prateek-narang%2F">Data Structures &amp; Algorithms, Level-up for Coding Interviews Course</a></li><li><a href="https://medium.com/techsoftware/become-a-job-ready-programmer-1e5a8cdd1351">Become a Job Ready Programmer (Java)</a></li><li><a href="https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/">Striver’s A2Z (Free) Course</a></li></ol><p>Top Coursera Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://imp.i384100.net/QyNgyo">Coding Interview Preparation (Meta)</a></li><li><a href="https://imp.i384100.net/KjqAe9">Algorithms Course Part I (Princeton University)</a></li><li><a href="https://imp.i384100.net/VmbWyE">Algorithms Course Part II (Princeton University)</a></li><li><a href="https://imp.i384100.net/g1AVOA">Data Structures and Algorithms Specialization (UC San Diego)</a></li><li><a href="https://imp.i384100.net/75G7ag">Algorithms Specialization (Stanford)</a></li></ol><p>(Note: The Coursera courses can be audited to get free access to the lectures)</p><p><strong>🎙 Disclosure:</strong> Please note that some of the links mentioned on this page may be affiliate links. This means that if you click on one of these links and make a purchase, I may earn a small commission from the sale.</p><p><strong>Who Am I?</strong></p><p>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Keep Learning</strong></p><p>Now, I guess this is where I say goodbye 👋. But, hey it’s time for you to start <strong>learning</strong> with your newfound Knowledge(Power)👨‍💻👩‍💻. Good Job that you made it this far 👏 &amp; <strong>Thank you</strong> so much for reading my Blog 🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=6318b05452a0" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/two-sum-leetcode-java-solution-6318b05452a0">Two Sum — LeetCode Java Solution</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Valid Anagram — LeetCode Java Solution]]></title>
            <link>https://medium.com/techsoftware/valid-anagram-leetcode-java-solution-e497872e5970?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/e497872e5970</guid>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[java]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[programming]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Sun, 02 Jul 2023 08:37:26 GMT</pubDate>
            <atom:updated>2023-07-15T13:47:21.847Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*tkCaUx45vVEN0dJAZl9sQg.jpeg" /></figure><h3>Valid Anagram — LeetCode Java Solution</h3><p>Hello readers, let’s solve a LeetCode problem today.</p><p>In this blog, let’s solve <a href="https://leetcode.com/problems/valid-anagram/">Valid Anagram</a> which is one of the <a href="https://leetcode.com/discuss/interview-question/460599/Blind-75-LeetCode-Questions">Blind 75 List of LeetCode Problems</a>.</p><p>This is a very good LeetCode Easy problem for beginners.</p><p>There are multiple potential solutions for this problem, which we will go through in this blog.</p><h4>Understand the problem</h4><p>An <strong>Anagram</strong> is a word or phrase formed by rearranging the letters of a different word or phrase, typically using all the original letters exactly once.</p><p>Given two strings s and t:</p><ul><li>return true , <em>if</em> t <em>is an anagram of</em> s</li><li>return false <em>otherwise</em>.</li></ul><h4>Understand the test cases</h4><p><strong>Example 1:</strong></p><pre>Input: s = &quot;anagram&quot;, t = &quot;nagaram&quot;<br>Output: true</pre><ul><li>The input strings “anagram” and “nagaram” exactly contain 3 — ’a’, 1 — ‘g’, 1 — ‘m’, 1 — ’n’ and 1 — ‘r’.</li><li>So, “nagaram” can be formed by rearranging the letters of “anagram”. And hence, they are both anagrams of each other.</li></ul><p><strong>Example 2:</strong></p><pre>Input: s = &quot;rat&quot;, t = &quot;car&quot;<br>Output: false</pre><ul><li>The string “car” does not contain the character ‘t’ from the string s: “rat”, so these are not anagrams.</li></ul><h4>Brute force Approach: Sorting</h4><pre>class Solution {<br>    public boolean isAnagram(String s, String t) {<br>        char[] sc = s.toCharArray();<br>        char[] tc = t.toCharArray();<br>        Arrays.sort(sc);<br>        Arrays.sort(tc);<br>        if(new String(sc).equals(new String(tc)))<br>            return true;<br>        return false;<br>    }<br>}</pre><p>Key Points:</p><ul><li>The above code checks if two strings, <strong>s</strong> and <strong>t</strong>, are anagrams by converting them into character arrays, sorting the arrays in ascending order, and then comparing the sorted arrays for equality.</li><li>If the sorted arrays of characters are equal, it means that the strings have the same characters in the same frequencies, indicating that they are anagrams of each other.</li><li>The code returns <strong>true</strong> if the strings are anagrams, and <strong>false</strong> otherwise.</li></ul><p>Time complexity: O(N log N)</p><ul><li>The time complexity of the above code is O(N log N), where N is the length of the longer string between <strong>s</strong> and <strong>t</strong>. This is because the code uses <strong>Arrays.sort()</strong> to sort the character arrays <strong>sc</strong> and <strong>tc</strong>.</li><li>The time complexity of the <strong>Arrays.sort()</strong> method is O(n log n) in the average case. Therefore, the overall time complexity is dominated by the sorting operation.</li></ul><p>Space complexity: O(N)</p><ul><li>The space complexity of the code is O(N), where N is the length of the longer string between <strong>s</strong> and <strong>t</strong>.</li><li>This is because the code creates two character arrays, <strong>sc</strong> and <strong>tc</strong>, which stores the characters of the input strings.</li><li>The length of each character array is equal to the length of the respective input string. Therefore, the space required by the character arrays is proportional to the length of the longer string.</li></ul><h4>Better Approach: Count using two HashMaps</h4><pre>class Solution {<br>    public boolean isAnagram(String s, String t) {<br>        HashMap&lt;Character, Integer&gt; count1 = new HashMap&lt;&gt;();<br>        HashMap&lt;Character, Integer&gt; count2 = new HashMap&lt;&gt;();<br>        count1 = count(count1, s);<br>        count2 = count(count2, t);<br>        return count1.equals(count2) ? true : false;<br>    }<br>    public HashMap&lt;Character, Integer&gt; count(HashMap&lt;Character, Integer&gt; count, String str) {<br>        for(int i=0; i&lt;str.length(); i++) {<br>            Character c=str.charAt(i);<br>            if(count.containsKey(c)) {<br>                count.put(c, count.get(c)+1);<br>                continue;<br>            }<br>            count.put(c, 1);<br>        }<br>        return count;<br>    }<br>}</pre><p>Key Points:</p><ul><li>HashMaps count1 and count2 are used to count the number of characters in the given two strings s and t respectively.</li><li>The function count() is used to traverse the given string, calculate the number of occurrences of a character and store them in the count HashMap and return it.</li><li>Finally, count1 and count2 are compared for equality to verify of the given two strings are anagrams of each other or not.</li></ul><p>Time Complexity: O(N)</p><ul><li>The time complexity of the given code is O(N), where N is the total number of characters in both strings combined. This is because the code iterates over each character in the strings once while building the frequency count in the <strong>count()</strong> method.</li><li>Since the <strong>count()</strong> method is called twice, once for each input string, the total time complexity is O(x + y), where x and y are the lengths of the input strings <strong>s</strong> and <strong>t</strong> respectively.</li><li>However, since we typically ignore constant factors and focus on the dominant term, the time complexity is simplified to O(N).</li></ul><p>Space Complexity: O(1) or Constant</p><ul><li>The space complexity of the code is O(k), where k is the number of unique characters across both strings.</li><li>In the worst-case scenario, each unique character in the strings will be stored as a key in the <strong>count1</strong> and <strong>count2</strong> HashMaps. Therefore, the space required by HashMaps is proportional to the number of unique characters.</li><li>Since the total number of unique characters is typically much smaller than the length of the strings, we can consider the space complexity to be O(1) or constant.</li></ul><h4>Optimal Approach: Count using a frequency array</h4><pre>public class Solution {<br>    public boolean isAnagram(String s, String t) {<br>        int[] alphabet = new int[26];<br>        for (int i = 0; i &lt; s.length(); i++) alphabet[s.charAt(i) - &#39;a&#39;]++;<br>        for (int i = 0; i &lt; t.length(); i++) alphabet[t.charAt(i) - &#39;a&#39;]--;<br>        for (int i : alphabet) if (i != 0) return false;<br>        return true;<br>    }<br>}</pre><p>Key Points:</p><ul><li>In the above code, a size 26 int array: alphabet is created as a frequency array for each letter in the Alphabet. The indices of the alphabet array represent the 26 letters of the Alphabet. So, 0 represents ‘a’, 1 represents ‘b’ so on until 25 represents ‘z’.</li><li>Then, we calculate the frequency of the characters:</li><li>We increment the alphabet array values for each of the characters of the String s in the first iteration.</li><li>And then decrement the values of the same alphabet array with string t in the second iteration.</li><li>In both iterations, we perform the operations s.charAt(i) - &#39;a&#39; and t.charAt(i) - &#39;a&#39; . Here, the characters of the string s and string t are subtracted from the character ‘a’ to get an integer value of the letters that correspond to the alphabet array.</li><li>If they are anagrams, the alphabet the bucket should remain with the initial value of the array which is zero.</li><li>So, the final iteration just checks if all values are zero, if any value is not zero, we return false and return true</li></ul><p>Time complexity: O(N)</p><ul><li>The time complexity of the above code is O(n), where n is the length of the longer string between <strong>s</strong> and <strong>t</strong>. This is because the code iterates over each character in both strings only once, using two separate loops.</li><li>The first loop counts the occurrences of characters in string <strong>s</strong>, and the second loop subtracts the occurrences of characters in string <strong>t</strong>. Finally, there is a third loop that checks if any count in the <strong>alphabet</strong> array is nonzero, indicating a mismatch in character counts between the two strings.</li></ul><p>Space complexity: O(1) or Constant</p><ul><li>The space complexity of the code is O(1) or constant because uses an integer array, <strong>alphabet</strong>, of size 26 to store the counts of characters in the English alphabet.</li><li>Regardless of the length of the input strings, the <strong>alphabet</strong> array remains a fixed size because it represents a fixed set of characters (lowercase English letters).</li><li>Therefore, the space required by the array is constant and does not depend on the input size.</li></ul><p><strong>NeetCode Solution Video</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F9UtInBqnCgA%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D9UtInBqnCgA&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F9UtInBqnCgA%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/cef4ab2e52fe22bfe6594c56d361948a/href">https://medium.com/media/cef4ab2e52fe22bfe6594c56d361948a/href</a></iframe><p><strong>Recommended Resources to Learn Data Structures and Algorithms</strong></p><p>Basics of DS Algo Blogs:</p><p>1. <a href="https://medium.com/techsoftware/understanding-hashing-in-java-exploring-hashmap-and-hashset-b2c7d28453c">Hashing in Java</a></p><p>Recommended YouTubers for LeetCode Problems:</p><p>1. <a href="https://www.youtube.com/@NeetCode">NeetCode</a></p><p>2. <a href="https://www.youtube.com/@takeUforward/featured">Take U Forward</a></p><p>Free Resources for Learning Data Structures and Algorithms:</p><p>1. <a href="https://neetcode.io/roadmap?utm_source=aswin">NeetCode Roadmap</a></p><p>2. <a href="https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/">Striver’s SDE Sheet</a></p><p>Recommended Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://neetcode.io/courses?utm_source=aswin">NeetCode Courses</a></li><li>ZTM: Mastering the Coding Interview (Big Tech): Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.3919716491451706865583445&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-big-tech-faang-interviews%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_rml6679s/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li>ZTM: Mastering the Coding Interview: Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391976131953022569348758&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-data-structures-algorithms%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_nqb6sg6w/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li><a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391975289945963380819471&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fcpp-data-structures-algorithms-levelup-prateek-narang%2F">Data Structures &amp; Algorithms, Level-up for Coding Interviews Course</a></li><li><a href="https://medium.com/techsoftware/become-a-job-ready-programmer-1e5a8cdd1351">Become a Job Ready Programmer (Java)</a></li><li><a href="https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/">Striver’s A2Z (Free) Course</a></li></ol><p>Top Coursera Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://imp.i384100.net/QyNgyo">Coding Interview Preparation (Meta)</a></li><li><a href="https://imp.i384100.net/KjqAe9">Algorithms Course Part I (Princeton University)</a></li><li><a href="https://imp.i384100.net/VmbWyE">Algorithms Course Part II (Princeton University)</a></li><li><a href="https://imp.i384100.net/g1AVOA">Data Structures and Algorithms Specialization (UC San Diego)</a></li><li><a href="https://imp.i384100.net/75G7ag">Algorithms Specialization (Stanford)</a></li></ol><p>(Note: The Coursera courses can be audited to get free access to the lectures)</p><p><strong>🎙 Disclosure:</strong> Please note that some of the links mentioned on this page may be affiliate links. This means that if you click on one of these links and make a purchase, I may earn a small commission from the sale.</p><p><strong>Who Am I?</strong></p><p>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Keep Learning</strong></p><p>Now, I guess this is where I say goodbye 👋. But, hey it’s time for you to start <strong>learning</strong> with your newfound Knowledge(Power)👨‍💻👩‍💻. Good Job that you made it this far 👏 &amp; <strong>Thank you</strong> so much for reading my Blog 🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=e497872e5970" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/valid-anagram-leetcode-java-solution-e497872e5970">Valid Anagram — LeetCode Java Solution</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Product of Array Except Self — LeetCode Java Solution]]></title>
            <link>https://medium.com/techsoftware/product-of-array-except-self-leetcode-java-solution-dbd4455f9b07?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/dbd4455f9b07</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Thu, 29 Jun 2023 16:35:36 GMT</pubDate>
            <atom:updated>2023-07-15T13:47:56.130Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*hRqH00UClApoSVsyGnsMGQ.jpeg" /></figure><h3>Product of Array Except Self — LeetCode Java Solution</h3><p>Hello readers, let’s solve a LeetCode problem today.</p><p>In this blog, let’s solve the problem <a href="https://leetcode.com/problems/product-of-array-except-self/">Product of Array Except Self</a> which is one of the <a href="https://leetcode.com/discuss/interview-question/460599/Blind-75-LeetCode-Questions">Blind 75 List of LeetCode Problems</a>.</p><p>This is a LeetCode Medium problem with multiple potential solutions, which we will go through in this blog.</p><h4>Understand the Problem</h4><p>The Objective of the problem is to calculate the product of all elements in an input array, except for the element at each index. The problem also mentions writing an algorithm that runs in O(n) time and without using the division operation.</p><h4>Understand the Testcases</h4><p>To test the solution, we can consider the following cases:</p><ol><li>Input: [1, 2, 3, 4] <br>Output: [24, 12, 8, 6] <br>Explanation: The product of all elements except the one at index 0 is 2 * 3 * 4 = 24. The product of all elements except the one at index 1 is 1 * 3 * 4 = 12. Similarly, for index 2, the product is 1 * 2 * 4 = 8, and for index 3, the product is 1 * 2 * 3 = 6.</li><li>Input: [4, 2, 1, 5, 3] <br>Output: [30, 60, 120, 24, 40] <br>Explanation: The product of all elements except the one at index 0 is 2 * 1 * 5 * 3 = 30. The product of all elements except the one at index 1 is 4 * 1 * 5 * 3 = 60. Similarly, for index 2, the product is 4 * 2 * 5 * 3 = 120, for index 3, the product is 4 * 2 * 1 * 3 = 24, and for index 4, the product is 4 * 2 * 1 * 5 = 40.</li><li>Input: [1, 1, 1, 1, 1] <br>Output: [1, 1, 1, 1, 1] <br>Explanation: Since all elements are the same, the product of all elements except the one at each index will be the same element itself.</li><li>Input: [0, 0, 0, 0] <br>Output: [0, 0, 0, 0] <br>Explanation: Since there are zero values in the input array, the product of all elements except the one at each index will be zero.</li><li>Input: [2, 3, 0, 4] <br>Output: [0, 0, 24, 0] <br>Explanation: The product of all elements except the one at index 0 is 3 * 0 * 4 = 0. The product of all elements except the one at index 1 is 2 * 0 * 4 = 0. For index 2, the product is 2 * 3 * 4 = 24, and for index 3, the product is 2 * 3 * 0 = 0.</li></ol><h4>Brute Force Approach</h4><p>The brute force approach will be to calculate the product of all values in the array except the current value using two nested iterations.</p><p>Key Points:</p><ul><li>For each value, calculate the product of all other values by iterating through the array twice.</li><li>This approach uses two nested loops to multiply each element with all other elements, excluding itself.</li><li>However, this method is inefficient and may lead to a Time Limit Exceeded (TLE) error for larger test cases.</li></ul><pre>class Solution {<br>    public int[] productExceptSelf(int[] nums) {<br>        int size = nums.length;<br>        int[] answer = new int[size];<br>        for(int i=0; i&lt;size; i++) {<br>            answer[i] = 1;<br>        }<br>        for(int i=0; i&lt;size; i++) {<br>            for(int j=0; j&lt;size; j++) {<br>                if(i==j) continue;<br>                answer[i] *= nums[j];<br>            }<br>        }<br>        return answer;<br>    }<br>}</pre><p>Time Complexity: O(N²)</p><ul><li>The time complexity of the brute force approach is quadratic, as it involves nested loops that iterate through the array.</li></ul><p>Space Complexity: O(1)</p><ul><li>The brute force approach doesn’t require any additional space other than the answer array, so the space complexity is constant.</li></ul><h4>Better Approach</h4><pre>class Solution {<br>    public int[] productExceptSelf(int[] nums) {<br>        int size = nums.length;<br>        int[] answer = new int[size];<br>        int[] prefix =  new int[size];<br>        int[] suffix =  new int[size];<br>        int temp = 1;<br>        for(int i=0; i&lt;size; i++) {<br>            prefix[i] = temp;<br>            temp *= nums[i];<br>        }<br>        temp = 1;<br>        for(int j=size-1; j&gt;=0; j--) {<br>            suffix[j] = temp;<br>            temp *= nums[j];<br>        }<br>        for(int i=0; i&lt;size; i++) {<br>            answer[i] = prefix[i] * suffix[i];<br>        }<br>        return answer;<br>    }<br>}</pre><p>Key Points:</p><ul><li>The better approach uses separate iterations to calculate prefix and suffix values for each element.</li><li>In this approach, we calculate the prefix products while traversing the array from left to right and storing them in the prefix array.</li><li>Then, we calculate the suffix products while traversing the array from right to left and storing them in the suffix array.</li><li>Finally, we multiply the corresponding prefix and suffix values to get the final products.</li></ul><p>Time Complexity: O(N)</p><ul><li>The better approach performs two linear passes through the array, resulting in a linear time complexity.</li></ul><p>Space Complexity: O(N)</p><ul><li>The better approach requires additional space to store the prefix and suffix arrays, resulting in linear space complexity.</li></ul><h4>Optimal Approach</h4><pre>class Solution {<br>    public int[] productExceptSelf(int[] nums) {<br>        int[] answer = new int[nums.length];<br>        int prefix = 1;<br>        for(int i=0; i&lt;nums.length; i++) {<br>            answer[i] = prefix;<br>            prefix *= nums[i];<br>        }<br>        int suffix = 1;<br>        for(int j=nums.length-1; j&gt;=0; j--) {<br>            answer[j] *= suffix;<br>            suffix *= nums[j];<br>        }<br>        return answer;<br>    }<br>}</pre><p>Key Points:</p><ul><li>The optimal approach further improves efficiency by using the output array to store the prefix products.</li><li>In this approach, we calculate the prefix products while traversing the array from left to right.</li><li>Then, we calculate the suffix products while traversing the array from right to left.</li><li>Finally, we multiply the suffix product with the corresponding prefix product to obtain the final answer.</li></ul><p>Time Complexity: O(N)</p><ul><li>The optimal approach also performs two linear passes through the array, resulting in a linear time complexity.</li></ul><p>Space Complexity: O(1)</p><ul><li>The optimal approach doesn’t require any additional space other than the output array, so the space complexity is constant.</li></ul><h4><strong>Conclusion</strong></h4><ul><li>The brute force solution has a time complexity of O(N²) but no extra memory usage.</li><li>Using two extra arrays improves the time complexity to O(N) but also requires extra memory with the complexity of O(N).</li><li>Using the linear traversals and answer array offers the best time complexity of O(N) but doesn’t require any additional space other than the output array, so the space complexity is constant, O(1).</li></ul><p><strong>NeetCode Solution Video</strong></p><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2FbNvIQI2wAjk&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3DbNvIQI2wAjk&amp;image=http%3A%2F%2Fi.ytimg.com%2Fvi%2FbNvIQI2wAjk%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/f533db4e0407f35e00bb2845a65745fa/href">https://medium.com/media/f533db4e0407f35e00bb2845a65745fa/href</a></iframe><h4>Recommended Resources to Learn Data Structures and Algorithms</h4><p>Basics of DS Algo Blogs:</p><p>1. <a href="https://medium.com/techsoftware/understanding-hashing-in-java-exploring-hashmap-and-hashset-b2c7d28453c">Hashing in Java</a></p><p>Recommended YouTubers for LeetCode Problems:</p><p>1. <a href="https://www.youtube.com/@NeetCode">NeetCode</a></p><p>2. <a href="https://www.youtube.com/@takeUforward/featured">Take U Forward</a></p><p>Free Resources for Learning Data Structures and Algorithms:</p><p>1. <a href="https://neetcode.io/roadmap?utm_source=aswin">NeetCode Roadmap</a></p><p>2. <a href="https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/">Striver’s SDE Sheet</a></p><p>Recommended Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://neetcode.io/courses?utm_source=aswin">NeetCode Courses</a></li><li>ZTM: Mastering the Coding Interview (Big Tech): Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.3919716491451706865583445&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-big-tech-faang-interviews%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_rml6679s/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li>ZTM: Mastering the Coding Interview: Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391976131953022569348758&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-data-structures-algorithms%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_nqb6sg6w/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li><a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391975289945963380819471&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fcpp-data-structures-algorithms-levelup-prateek-narang%2F">Data Structures &amp; Algorithms, Level-up for Coding Interviews Course</a></li><li><a href="https://medium.com/techsoftware/become-a-job-ready-programmer-1e5a8cdd1351">Become a Job Ready Programmer (Java)</a></li><li><a href="https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/">Striver’s A2Z (Free) Course</a></li></ol><p>Top Coursera Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://imp.i384100.net/QyNgyo">Coding Interview Preparation (Meta)</a></li><li><a href="https://imp.i384100.net/KjqAe9">Algorithms Course Part I (Princeton University)</a></li><li><a href="https://imp.i384100.net/VmbWyE">Algorithms Course Part II (Princeton University)</a></li><li><a href="https://imp.i384100.net/g1AVOA">Data Structures and Algorithms Specialization (UC San Diego)</a></li><li><a href="https://imp.i384100.net/75G7ag">Algorithms Specialization (Stanford)</a></li></ol><p>(Note: The Coursera courses can be audited to get free access to the lectures)</p><p><strong>🎙 Disclosure:</strong> Please note that some of the links mentioned on this page may be affiliate links. This means that if you click on one of these links and make a purchase, I may earn a small commission from the sale.</p><p><strong>Who Am I?</strong></p><p>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Keep Learning</strong></p><p>Now, I guess this is where I say goodbye 👋. But, hey it’s time for you to start <strong>learning</strong> with your newfound Knowledge(Power)👨‍💻👩‍💻. Good Job that you made it this far 👏 &amp; <strong>Thank you</strong> so much for reading my Blog 🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=dbd4455f9b07" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/product-of-array-except-self-leetcode-java-solution-dbd4455f9b07">Product of Array Except Self — LeetCode Java Solution</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Contains Duplicate — LeetCode Java Solution]]></title>
            <link>https://medium.com/techsoftware/contains-duplicate-leetcode-java-solution-de523269b436?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/de523269b436</guid>
            <category><![CDATA[leetcode]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 14:34:11 GMT</pubDate>
            <atom:updated>2023-07-15T13:48:19.701Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*WHlmA5fejJcHeqK0SnT7kg.jpeg" /></figure><h3>Contains Duplicate — LeetCode Java Solution</h3><p>Hello readers, let’s solve a LeetCode problem today.</p><p>In this blog, let’s solve <a href="https://leetcode.com/problems/contains-duplicate/">Contains Duplicate</a> which is one of the <a href="https://leetcode.com/discuss/interview-question/460599/Blind-75-LeetCode-Questions">Blind 75 List of LeetCode Problems</a>.</p><p>This is a very good LeetCode Easy problem for beginners.</p><p>There are multiple potential solutions for this problem, which we will go through in this blog.</p><h4><strong>Understand the Problem</strong></h4><p>The Objective of the problem is to Determine if an array contains any duplicate values</p><p>In the Problem Description, it is given:</p><ul><li>Given an array of numbers: nums</li><li>Return true if there are any values in the array that appear at least twice</li><li>Return false if all values in the array are distinct</li></ul><h4><strong>Understand the Testcases</strong></h4><p>To understand the problem better, three examples are given:</p><p>In Example 1, it is given:</p><ul><li>Input: nums = [1,2,3,1]</li><li>Output: true</li></ul><p>Here, we can spot there are two ones 1 at the first and last index and hence 1 is the duplicate value in this array. So, we can return the output true.</p><p>In Example 2, it is given:</p><ul><li>Input: nums = [1,2,3,4]</li><li>Output: false</li></ul><p>Here, we can see that all four numbers are distinct values in this array. So, we can return the output false.</p><p>In Example 3, it is given:</p><ul><li>Input: nums = [1,1,1,3,3,4,3,2,4,2]</li><li>Output: true</li></ul><p>Here, we can see many duplicate values of the numbers 1,2,3 and 4 in this array. So, we can return the output true.</p><h4><strong>Brute Force Approach</strong></h4><p>The brute force approach will be to compare each number with every other number in the array until we find the duplicate number.</p><pre>class Solution {<br>    public boolean containsDuplicate(int[] nums) {<br>        for(int i=0;i&lt;nums.length; i++) {<br>            for(int j=i+1; j&lt;nums.length; j++) {<br>                if(nums[i] == nums[j]) { <br>                    // found the duplicate<br>                    return true;<br>                }<br>            }<br>        }<br>        return false;<br>    }<br>}</pre><p>Here are the key points to understand the code:</p><ul><li>This approach follows a brute force method of comparing each number with every other number in the array to find duplicates.</li><li>We use nested loops to traverse through all possible pairs of elements in the array.</li><li>The outer loop iterates over each element in the array, and the inner loop compares that element with the remaining elements.</li><li>If any two elements are found to be equal, it means we have found a duplicate value, and we return true.</li><li>After comparing all possible pairs and not finding any duplicates, we return false.</li></ul><p>Time complexity:</p><ul><li>The time complexity of this approach is O(N²), where N is the number of elements in the ‘nums’ array. This is because we have nested loops, causing us to compare each element with every other element in the worst case.</li></ul><p>Space complexity:</p><ul><li>The space complexity of this approach is O(1) because it does not require any additional space that grows with the input size.</li></ul><h4><strong>Better Approach:</strong></h4><pre>class Solution {<br>	public boolean containsDuplicate(int[] nums) {<br>		Arrays.sort(nums);<br>		for (int i = 0; i &lt; nums.length - 1; i++) {<br>			if (nums[i] == nums[i+1]) {<br>				return true;<br>			}<br>		}<br>		return false;<br>	}<br>}</pre><p>Here are the key points to understand the code:</p><ul><li>This approach takes advantage of sorting the array first to simplify the duplicate checking process.</li><li>The array is sorted in ascending order using the <strong>Arrays.sort()</strong> method.</li><li>By sorting the array, duplicate elements become adjacent to each other, making it easier to identify duplicates by comparing adjacent elements.</li><li>We traverse the sorted array and compare each element with its next adjacent element.</li><li>If any adjacent elements are equal, it means we have found a duplicate value, and we return true.</li><li>If no duplicates are found after checking all adjacent pairs, we return false.</li></ul><p>Time complexity:</p><ul><li>The time complexity of this approach is O(N * log(N)), where N is the number of elements in the ‘nums’ array. This is because sorting the array takes O(N * log(N)) time using efficient sorting algorithms like Merge Sort or Quick Sort.</li></ul><p>Space complexity:</p><ul><li>The space complexity of this approach is O(log(N)), where N is the number of elements in the ‘nums’ array. This space is used for the recursive calls in the sorting algorithm.</li></ul><h4><strong>Optimal Approach (Using HashSet):</strong></h4><ul><li>We can use a HashSet to efficiently check for duplicates in the given array.</li><li>HashSet is a data structure that stores unique elements. It allows for constant-time (O(1)) operations like adding and searching for elements.</li></ul><pre>class Solution {<br>    public boolean containsDuplicate(int[] nums) {<br>        HashSet&lt;Integer&gt; dups = new HashSet&lt;Integer&gt;();<br>        for (int n : nums) {<br>            if (dups.contains(n)) {<br>                return true;<br>            }<br>            dups.add(n);<br>        }<br>        return false;<br>    }<br>}</pre><p>Here are the key points to understand the code:</p><ul><li>We traverse the ‘nums’ array and for each element ’n’, we check if it is already present in the HashSet.</li><li>If the value is present, it means we have found a duplicate, so we return true.</li><li>If the value is not present, we add it to the HashSet to keep track of unique elements.</li><li>After traversing the entire array and not finding any duplicates, we return false.</li></ul><p>Time complexity:</p><ul><li>The time complexity of this solution is O(N), where N is the number of elements in the ‘nums’ array. This is because we traverse the entire array once.</li></ul><p>Space complexity:</p><ul><li>The space complexity of this solution is O(N), where N is the number of elements in the ‘nums’ array. This is because in the worst case, all elements in the array could be unique and stored in the HashSet.</li></ul><h4><strong>Conclusion</strong></h4><ul><li>The brute force solution has a time complexity of O(N²) but no extra memory usage.</li><li>Sorting the array improves the time complexity to O(N * log(N)) but still requires no extra memory.</li><li>Using a HashMap &amp; HashSet offers the best time complexity of O(N) but requires additional memory.</li></ul><h4><strong>NeetCode Solution Video:</strong></h4><iframe src="https://cdn.embedly.com/widgets/media.html?src=https%3A%2F%2Fwww.youtube.com%2Fembed%2F3OamzN90kPg%3Ffeature%3Doembed&amp;display_name=YouTube&amp;url=https%3A%2F%2Fwww.youtube.com%2Fwatch%3Fv%3D3OamzN90kPg&amp;image=https%3A%2F%2Fi.ytimg.com%2Fvi%2F3OamzN90kPg%2Fhqdefault.jpg&amp;key=a19fcc184b9711e1b4764040d3dc5c07&amp;type=text%2Fhtml&amp;schema=youtube" width="854" height="480" frameborder="0" scrolling="no"><a href="https://medium.com/media/98ea74e8f04fa4e6833aee66ad42fe96/href">https://medium.com/media/98ea74e8f04fa4e6833aee66ad42fe96/href</a></iframe><h4><strong>Recommended Resources to Learn Data Structures and Algorithms</strong></h4><p>Basics of DS Algo Blogs:<br>1. <a href="https://medium.com/techsoftware/understanding-hashing-in-java-exploring-hashmap-and-hashset-b2c7d28453c">Hashing in Java</a></p><p>Recommended YouTubers for LeetCode Problems:<br>1. <a href="https://www.youtube.com/@NeetCode">NeetCode</a><br>2. <a href="https://www.youtube.com/@takeUforward/featured">Take U Forward</a></p><p>Free Resources for Learning Data Structures and Algorithms:<br>1. <a href="https://neetcode.io/roadmap?utm_source=aswin">NeetCode Roadmap</a><br>2. <a href="https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/">Striver’s SDE Sheet</a></p><p>Recommended Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://neetcode.io/courses?utm_source=aswin">NeetCode Courses</a></li><li>ZTM: Mastering the Coding Interview (Big Tech): Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.3919716491451706865583445&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-big-tech-faang-interviews%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_rml6679s/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li>ZTM: Mastering the Coding Interview: Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391976131953022569348758&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-data-structures-algorithms%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_nqb6sg6w/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li><a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391975289945963380819471&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fcpp-data-structures-algorithms-levelup-prateek-narang%2F">Data Structures &amp; Algorithms, Level-up for Coding Interviews Course</a></li><li><a href="https://medium.com/techsoftware/become-a-job-ready-programmer-1e5a8cdd1351">Become a Job Ready Programmer (Java)</a></li><li><a href="https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/">Striver’s A2Z (Free) Course</a></li></ol><p>Top Coursera Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://imp.i384100.net/QyNgyo">Coding Interview Preparation (Meta)</a></li><li><a href="https://imp.i384100.net/KjqAe9">Algorithms Course Part I (Princeton University)</a></li><li><a href="https://imp.i384100.net/VmbWyE">Algorithms Course Part II (Princeton University)</a></li><li><a href="https://imp.i384100.net/g1AVOA">Data Structures and Algorithms Specialization (UC San Diego)</a></li><li><a href="https://imp.i384100.net/75G7ag">Algorithms Specialization (Stanford)</a></li></ol><p>(Note: The Coursera courses can be audited to get free access to the lectures)</p><p><strong>🎙 Disclosure: </strong>Please note that some of the links mentioned on this page may be affiliate links. This means that if you click on one of these links and make a purchase, I may earn a small commission from the sale.</p><p><strong>Who Am I?<br></strong>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Keep Learning<br></strong>Now, I guess this is where I say goodbye 👋. But, hey it’s time for you to start <strong>learning</strong> with your newfound Knowledge(Power)👨‍💻👩‍💻. Good Job that you made it this far 👏 &amp; <strong>Thank you</strong> so much for reading my Blog 🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=de523269b436" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/contains-duplicate-leetcode-java-solution-de523269b436">Contains Duplicate — LeetCode Java Solution</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Understanding Hashing in Java: Exploring HashMap and HashSet]]></title>
            <link>https://medium.com/techsoftware/understanding-hashing-in-java-exploring-hashmap-and-hashset-b2c7d28453c?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/b2c7d28453c</guid>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[data-structures]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[problem-solving]]></category>
            <category><![CDATA[java]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Wed, 28 Jun 2023 14:28:52 GMT</pubDate>
            <atom:updated>2023-08-21T02:28:33.300Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*7HWx33DTqpXYahmKt7mxgg.jpeg" /></figure><p>Hashing is a fundamental concept in computer science and plays a crucial role in efficient data storage and retrieval.</p><p>In this blog post, we will explore hashing in the context of Java programming language, focusing on two important classes: HashMap and HashSet.</p><p>We’ll cover the basics of hashing, explain the purpose and usage of HashMap and HashSet, provide Java syntax examples, showcase practical use cases, and discuss problem-solving patterns. So let’s dive in!</p><h4><strong>What is Hashing?</strong></h4><p>Hashing is a technique used to map data to a fixed-size value, known as a hash code or hash. It takes an input, performs some calculations on it, and produces a unique hash code. The resulting hash code is used as an index or key to store or retrieve data in a data structure.</p><h3><strong>What is HashMap?</strong></h3><p>HashMap is a class in Java’s Collections framework that implements the Map interface. It provides a way to store key-value pairs, where each key is unique. The keys are hashed to generate hash codes, which are then used to index and store the corresponding values. HashMap allows for efficient retrieval and modification of data.</p><h4><strong>Java Syntax for HashMap:</strong></h4><p>To create a HashMap in Java, you need to import the java.util.HashMap class. Here’s the syntax for creating a HashMap:</p><pre>import java.util.HashMap;<br>HashMap&lt;KeyType, ValueType&gt; map = new HashMap&lt;&gt;();</pre><p>The KeyType represents the data type of the keys, and ValueType represents the data type of the values.</p><h4><strong>Important Methods in HashMap:</strong></h4><ul><li><strong>put(key, value)</strong>: Inserts a key-value pair into the HashMap.</li><li><strong>get(key)</strong>: Retrieves the value associated with the specified key.</li><li><strong>containsKey(key)</strong>: Checks if the HashMap contains a specific key.</li><li><strong>containsValue(value)</strong>: Checks if the HashMap contains a specific value.</li><li><strong>remove(key)</strong>: Removes the key-value pair associated with the specified key.</li><li><strong>size()</strong>: Returns the number of key-value pairs in the HashMap.</li></ul><h4><strong>Java Example for HashMap:</strong></h4><p>Let’s consider an example where we store the ages of individuals using their names as keys in a HashMap:</p><pre>import java.util.HashMap;<br>HashMap&lt;String, Integer&gt; ageMap = new HashMap&lt;&gt;();<br>ageMap.put(&quot;Alice&quot;, 28);<br>ageMap.put(&quot;Bob&quot;, 35);<br>ageMap.put(&quot;Charlie&quot;, 42);<br>System.out.println(ageMap.get(&quot;Alice&quot;)); // Output: 28</pre><p>In this example, we create a HashMap ageMap with keys of type String and values of type Integer. We store the ages of three individuals and retrieve Alice&#39;s age using her name as the key.</p><h3><strong>What is HashSet?</strong></h3><p>HashSet is another class in Java’s Collections framework that implements the Set interface. It represents a collection of unique elements where the order is not important. HashSet uses hashing internally to store and retrieve elements efficiently.</p><h4><strong>Java Syntax for HashSet:</strong></h4><p>To create a HashSet in Java, you need to import the java.util.HashSet class. Here’s the syntax:</p><pre>import java.util.HashSet;<br>HashSet&lt;ElementType&gt; set = new HashSet&lt;&gt;();</pre><p>The ElementType represents the data type of the elements in the set.</p><h4><strong>Important Methods in HashSet:</strong></h4><ul><li><strong>add(element)</strong>: Adds an element to the HashSet.</li><li><strong>contains(element)</strong>: Checks if the HashSet contains a specific element.</li><li><strong>remove(element)</strong>: Removes an element from the HashSet.</li><li><strong>size()</strong>: Returns the number of elements in the HashSet.</li></ul><h4><strong>Java Example for HashSet:</strong></h4><p>Let’s consider an example where we store a list of unique names using a HashSet:</p><pre>import java.util.HashSet;<br>HashSet&lt;String&gt; nameSet = new HashSet&lt;&gt;();<br>nameSet.add(&quot;Alice&quot;);<br>nameSet.add(&quot;Bob&quot;);<br>nameSet.add(&quot;Charlie&quot;);<br>System.out.println(nameSet.contains(&quot;Alice&quot;)); // Output: true</pre><p>In this example, we create a HashSet nameSet with elements of type String. We add three unique names and check if &quot;Alice&quot; exists in the set using the contains() method.</p><h4><strong>Practical Use Cases of HashMap and HashSet:</strong></h4><ol><li>Data Indexing: HashMap is commonly used for efficient indexing and retrieval of data based on unique keys. For example, it can be used to store user profiles with usernames as keys.</li><li>Eliminating Duplicates: HashSet is useful for removing duplicate elements from a collection. It can be used to filter unique values from a list or to check for the presence of duplicates.</li><li>Caching: HashMap can be employed as a cache mechanism, where expensive calculations or database queries can be stored and retrieved quickly using unique keys.</li></ol><h4><strong>Problem-Solving Patterns with HashMap and HashSet:</strong></h4><ol><li>Frequency Counting: HashMap can be utilized to count the frequency of elements in a list or string. It is helpful in solving problems related to finding duplicates or analyzing character/word occurrences.</li><li>Set Operations: HashSet provides efficient set operations like union, intersection, and difference. These operations are beneficial in solving problems related to finding common elements or distinct values.</li></ol><p><strong>Conclusion: </strong><br>Hashing is a powerful technique that enables efficient storage and retrieval of data in Java. HashMap and HashSet are two essential classes that leverage hashing to provide key-value mapping and store unique elements, respectively. By understanding the concepts, syntax, practical use cases, important methods, and problem-solving patterns of HashMap and HashSet, you’ll have a solid foundation to leverage these classes effectively in your Java projects.</p><h4><strong>Recommended Resources to Learn Data Structures and Algorithms</strong></h4><p>Free Resources for Learning Data Structures and Algorithms:<br>1. <a href="https://neetcode.io/roadmap?utm_source=aswin">NeetCode Roadmap</a><br>2. <a href="https://takeuforward.org/interviews/strivers-sde-sheet-top-coding-interview-problems/">Striver’s SDE Sheet</a></p><p>Recommended Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://neetcode.io/courses?utm_source=aswin">NeetCode Courses</a></li><li>ZTM: Mastering the Coding Interview (Big Tech): Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.3919716491451706865583445&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-big-tech-faang-interviews%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_rml6679s/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li>ZTM: Mastering the Coding Interview: Available on <a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391976131953022569348758&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fmaster-the-coding-interview-data-structures-algorithms%2F">Udemy</a> and <a href="https://academy.zerotomastery.io/a/aff_nqb6sg6w/external?affcode=441520_dcwk-s8s">ZTM Academy</a></li><li><a href="https://click.linksynergy.com/link?id=JDofPMV5KuY&amp;offerid=1060092.391975289945963380819471&amp;type=2&amp;murl=https%3A%2F%2Fwww.udemy.com%2Fcourse%2Fcpp-data-structures-algorithms-levelup-prateek-narang%2F">Data Structures &amp; Algorithms, Level-up for Coding Interviews Course</a></li><li><a href="https://medium.com/techsoftware/become-a-job-ready-programmer-1e5a8cdd1351">Become a Job Ready Programmer (Java)</a></li><li><a href="https://takeuforward.org/strivers-a2z-dsa-course/strivers-a2z-dsa-course-sheet-2/">Striver’s A2Z (Free) Course</a></li></ol><p>Top Coursera Courses for Learning Data Structures and Algorithms:</p><ol><li><a href="https://imp.i384100.net/QyNgyo">Coding Interview Preparation (Meta)</a></li><li><a href="https://imp.i384100.net/KjqAe9">Algorithms Course Part I (Princeton University)</a></li><li><a href="https://imp.i384100.net/VmbWyE">Algorithms Course Part II (Princeton University)</a></li><li><a href="https://imp.i384100.net/g1AVOA">Data Structures and Algorithms Specialization (UC San Diego)</a></li><li><a href="https://imp.i384100.net/75G7ag">Algorithms Specialization (Stanford)</a></li></ol><p>(Note: The Coursera courses can be audited to get free access to the lectures)</p><p><strong>Who Am I?<br></strong>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>🎙 Disclosure: </strong>Please note that some of the links mentioned on this page may be affiliate links. This means that if you click on one of these links and make a purchase, I may earn a small commission from the sale.</p><p><strong>Keep Learning<br></strong>Now, I guess this is where I say goodbye 👋. But, hey it’s time for you to start <strong>learning</strong> with your newfound Knowledge(Power)👨‍💻👩‍💻. Good Job that you made it this far 👏 &amp; <strong>Thank you</strong> so much for reading my Blog 🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b2c7d28453c" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/understanding-hashing-in-java-exploring-hashmap-and-hashset-b2c7d28453c">Understanding Hashing in Java: Exploring HashMap and HashSet</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Conditional Statements: Making Decisions in JavaScript ]]></title>
            <link>https://medium.com/techsoftware/conditional-statements-making-decisions-in-javascript-fc0d7a8d9a5?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/fc0d7a8d9a5</guid>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Thu, 01 Jun 2023 05:04:51 GMT</pubDate>
            <atom:updated>2023-06-01T05:04:34.999Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYoAT-SA9P_2159Sollf6A.png" /><figcaption>Design by <a href="https://medium.com/@aswinbarath">Aswin Barath</a></figcaption></figure><p>Welcome to the fascinating world of JavaScript, where lines of code come alive and make decisions for themselves!</p><p>Imagine a scenario where your code has a mind of its own, capable of making choices and taking actions based on different conditions. Well, in JavaScript, this is made possible through the magic of conditional statements. 🪄💻</p><p>So, grab your favourite coding beverage and let’s dive into the world of decision-making in JavaScript!</p><p><strong>The Basics of Conditional Statements</strong></p><p>In JavaScript, conditional statements allow us to control the flow of our code based on certain conditions. Think of them as the if-else statements of the programming world. They enable our code to make decisions and perform different actions depending on whether a particular condition is true or false. 🤔</p><p><strong>the </strong><strong>if statement</strong></p><p>The most basic form of a conditional statement in JavaScript is the if statement.</p><p>Syntax:</p><pre>if (condition) {<br>  // Code to execute if the condition is true<br>}</pre><p>It’s like a fork in the road, where the code decides which path to take based on the condition. If the condition is true, the code block inside the curly braces will be executed; otherwise, it will be skipped. Simple, right?</p><p>Let’s see a real example to understand it better. Imagine you’re writing a program to check if a given number is even or odd. Here’s how you can do it in JavaScript:</p><pre>let number = 8;</pre><pre>if (number % 2 === 0) {<br>  console.log(&quot;The number is even.&quot;);<br>}</pre><p>Output:</p><pre>The number is even.</pre><p>In this example, the condition number % 2 === 0 checks if the remainder of number divided by 2 is equal to 0. If it is, the code inside the curly braces is executed, and it prints &quot;The number is even.&quot; Try running this code, and you&#39;ll see the output as expected!</p><p><strong>the </strong><strong>else statement</strong></p><p>But what if we want to handle the opposite case? Here, we can use the else statement!</p><p>When combined with if, the else statement allows us to specify an alternative code block to execute if the condition is false. Here&#39;s another example:</p><pre>let number = 7;</pre><pre>if (number % 2 === 0) {<br>  console.log(&quot;The number is even.&quot;);<br>} else {<br>  console.log(&quot;The number is odd.&quot;);<br>}</pre><p>Output:</p><pre>The number is odd.</pre><p>Now our code can cover both sides of the story. If the number is even, it prints “The number is even.” Otherwise, it prints “The number is odd.” Running this code will give you the expected output based on the value of the number variable.</p><p><strong>Expanding the Possibilities with Else If</strong></p><p>Sometimes, a simple true or false decision isn’t enough. We need more options, more forks in the road. That’s where the else if statement comes to the rescue!</p><p>With else if, we can test additional conditions if the previous ones turn out to be false. It&#39;s like having multiple paths to choose from, each with its own set of conditions. Let&#39;s see an example:</p><pre>let number = 0;<br>if (number === 0) {<br>  console.log(&quot;The number is zero.&quot;);<br>} else if (number % 2 === 0) {<br>  console.log(&quot;The number is even.&quot;);<br>} else {<br>  console.log(&quot;The number is odd.&quot;);<br>}</pre><p>Output:</p><pre>The number is zero.</pre><p>In this example, we added another condition to check if the number is zero. As the first condition is true and the number is zero, it prints “The number is zero.” Give it a try with different values of number and see how the output changes accordingly!</p><p><strong>Logical Operators: Combining Conditions</strong></p><p>Now, what if we want to test multiple conditions at the same time?</p><p>That’s where logical operators come into play. They allow us to combine conditions and create more complex decision-making structures.</p><p>JavaScript offers three logical operators:</p><ol><li>&amp;&amp; (AND),</li><li>|| (OR),</li><li>! (NOT).</li></ol><p>These symbols give our code superpowers, enabling it to evaluate multiple conditions simultaneously. Let’s see them in action:</p><p><strong>The </strong><strong>&amp;&amp; (AND) operator</strong></p><p>The &amp;&amp; operator checks if <strong>both</strong> conditions are true. It&#39;s like saying, &quot;I want my code to take action only if <strong>both</strong> of these things are true.&quot; For example:</p><pre>let number = 10;</pre><pre>if (number &gt; 0 &amp;&amp; number &lt; 100) {<br>  console.log(&quot;The number is between 0 and 100.&quot;);<br>}</pre><p>Output:</p><pre>The number is between 0 and 100.</pre><p>In this example, the code checks if the number variable is greater than 0 <strong>and</strong> less than 100. If both conditions are true, it prints &quot;The number is between 0 and 100.&quot; Try changing the value of number and observe the output.</p><p><strong>The </strong><strong>|| (OR) operator</strong></p><p>The || operator checks if <strong>either</strong> condition is true. It&#39;s like saying, &quot;I&#39;m happy as long as <strong>one</strong> of these things is true.&quot; For example:</p><pre>let color = &quot;red&quot;;</pre><pre>if (color === &quot;red&quot; || color === &quot;blue&quot;) {<br>  console.log(&quot;The color is either red or blue.&quot;);<br>}</pre><p>Output:</p><pre>The color is either red or blue.</pre><p>In this example, the code checks if the color variable is equal to &quot;red&quot; <strong>or</strong> &quot;blue.&quot; If either condition is true, it prints &quot;The color is either red or blue.&quot; Change the value of color and see how the output changes.</p><p><strong>The </strong><strong>! (NOT) operator</strong></p><p>The ! operator negates a condition. It&#39;s like saying, &quot;Hey, code, please do the opposite of what this condition says.&quot; For example:</p><pre>let loggedIn = false;</pre><pre>if (!loggedIn) {<br>  console.log(&quot;Please log in to continue.&quot;);<br>}</pre><p>Output:</p><pre>Please log in to continue.</pre><p>In this example, the code checks if the loggedIn variable is <strong>not</strong> true. If the condition is true (i.e., loggedIn is false), it prints &quot;Please log in to continue.&quot; Try changing the value of loggedIn and observe the output.</p><p>These logical operators add a new dimension to our decision-making capabilities. With them, our code becomes smarter and more adaptable! 🧠💪</p><p><strong>Wrapping Up</strong></p><p>Congratulations! You’ve now unlocked the power of conditional statements in JavaScript. You can now create code that makes decisions, takes different paths, and adapts to various scenarios. Your code is no longer bound by a single linear path. It can branch out, explore, and make choices. 🌟</p><p>Remember, conditional statements are a fundamental tool in JavaScript, and mastering them will take your coding skills to the next level. So go forth, embrace the power of decisions, and let your code navigate the twists and turns of programming with confidence!</p><p><strong>Who Am I?</strong></p><p>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Join me to learn JavaScript!</strong></p><p>Checkout the <a href="https://medium.com/techsoftware/javascript/home"><strong>TechSoftware Feature Page</strong></a> where my mission is to share my knowledge on JavaScript: <a href="https://medium.com/techsoftware/javascript/home">https://medium.com/techsoftware/javascript/home</a></p><p>Learn what I know about JavaScript from any of my favourite knowledge sources:</p><ul><li>Mozilla Developer Network (MDN) Web Docs: <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Guide/Control_flow_and_error_handling#conditional_statements">Conditional statements</a></li><li>W3Schools: <a href="https://www.w3schools.com/js/js_if_else.asp">JavaScript If…Else</a></li><li><a href="http://javascript.info/">JavaScript.info</a>: <a href="https://javascript.info/ifelse">Conditional Operators</a></li><li><a href="https://medium.com/techsoftware/the-complete-web-developer-in-2022-zero-to-mastery-40b009305c6?source=friends_link&amp;sk=4dbac18b2574292b479ae3ca545666e9">Complete Web Developer Course</a></li><li><a href="https://medium.com/techsoftware/course-review-the-complete-junior-to-senior-web-developer-roadmap-2022-b1dd7061797?source=friends_link&amp;sk=da2293918883104611c14ff4a9bc7d4d">Junior to Senior Developer Course</a></li><li><a href="https://medium.com/techsoftware/top-5-javascript-courses-on-udemy-is-it-worth-it-68bd8b85fbe4">Top 5 JavaScript Courses on Udemy</a></li><li><a href="https://youtu.be/ry8i5Qam7RI">JavaScript Roadmap — The Basics: Event Recording</a></li><li>Eloquent JavaScript: <a href="https://eloquentjavascript.net/02_program_structure.html#h_umoXp9u0e7">Control Flow</a></li></ul><p><strong>Thank you</strong> so much for reading my blog🙂.</p><p>Until next time, happy coding! 😄🚀</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=fc0d7a8d9a5" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/conditional-statements-making-decisions-in-javascript-fc0d7a8d9a5">Conditional Statements: Making Decisions in JavaScript 😎🔀</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[MongoDB Made Easy: Installation and Basics Unveiled]]></title>
            <link>https://medium.com/techsoftware/mongodb-made-easy-installation-and-basics-unveiled-29953e33187?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/29953e33187</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[mongodb]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[database]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Wed, 31 May 2023 15:33:51 GMT</pubDate>
            <atom:updated>2023-05-31T15:33:38.438Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*PiUnevInqC2uJNnnolplMw.jpeg" /><figcaption>Photo by <a href="https://unsplash.com/@rubaitulazad?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Rubaitul Azad</a> on <a href="https://unsplash.com/photos/cijiWIwsMB8?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>MongoDB is a popular NoSQL database that provides a flexible and scalable solution for managing and storing data. In this blog post, we will cover the basics of MongoDB and guide you through the installation process step by step.</p><p><strong>What is MongoDB?</strong></p><p>MongoDB is a document-oriented database that uses a flexible, JSON-like data model. Unlike traditional relational databases, MongoDB does not require a predefined schema, allowing for dynamic and easy handling of data. It is designed to handle large amounts of data and provide high availability and horizontal scalability.</p><p>Some key features of MongoDB include:</p><ul><li>Document data model: MongoDB stores data in flexible, self-describing documents in JSON-like BSON format. Each document can have a different structure, allowing for easy schema evolution.</li><li>Scalability: MongoDB can scale horizontally across multiple servers and handle large datasets and high traffic loads.</li><li>Indexing: MongoDB supports various types of indexes, including single-field, multi-field, and geospatial indexes, to optimize query performance.</li><li>Rich query language: MongoDB provides a powerful query language with support for complex queries, aggregations, and geospatial queries.</li></ul><p>Now that we have a brief understanding of MongoDB, let’s proceed with the installation process.</p><p><strong>MongoDB Installation</strong></p><p>To install MongoDB, follow these steps:</p><p><strong>Step 1: Download MongoDB</strong></p><ol><li>Visit the official MongoDB website at <a href="https://www.mongodb.com/">https://www.mongodb.com</a> and navigate to the Downloads page.</li><li>Choose the appropriate version of MongoDB for your operating system and download the installer.</li></ol><p><strong>Step 2: Run the Installer</strong></p><ol><li>Locate the downloaded installer file and double-click on it to run the MongoDB installer.</li><li>Follow the on-screen instructions to proceed with the installation. You can choose the installation directory and select additional components to install, such as MongoDB Compass, a graphical user interface for MongoDB.</li><li>Once the installation is complete, make sure the option to start the MongoDB server automatically is selected.</li></ol><p><strong>Step 3: Add MongoDB Bin Directory to the System Path (Windows)</strong></p><ol><li>Open the Start menu and search for “environment variables.”</li><li>Click on “Edit the system environment variables.”</li><li>In the System Properties window, click on the “Environment Variables” button.</li><li>In the “System variables” section, locate the “Path” variable and click on “Edit.”</li><li>Click on “New” and add the path to the MongoDB bin directory. By default, the bin directory is located at “C:\Program Files\MongoDB\Server\{version}\bin”.</li><li>Click “OK” to save the changes.</li></ol><p><strong>Step 4: Verify the MongoDB Installation</strong></p><ol><li>Open a new command prompt window.</li><li>Run the following command to check if MongoDB is installed and configured correctly:</li></ol><pre>mongod --version</pre><ul><li>This command should display the installed MongoDB version.</li></ul><p><strong>Step 5: Create the MongoDB Data Directory</strong></p><ol><li>Open the C drive in File Explorer.</li><li>Create a new folder named “data”.</li><li>Inside the “data” folder, create another folder named “db”. This is the default data directory used by MongoDB.</li></ol><p><strong>Step 6: Start the MongoDB Server</strong></p><ol><li>In the command prompt, run the following command to start the MongoDB server:</li></ol><pre>mongod</pre><ul><li>If everything is set up correctly, the MongoDB server should start successfully without any errors.</li><li>Note: Keep the command prompt window running to keep the server active.</li></ul><p><strong>Step 7: Install MongoDB Shell (mongosh)</strong></p><ol><li>Download the MongoDB shell (mongosh) separately from the official MongoDB website at <a href="https://www.mongodb.com/try/download/shell">https://www.mongodb.com/try/download/shell</a></li><li>Extract the contents of the downloaded ZIP file.</li><li>Move the extracted MongoDB shell folder to the MongoDB installation folder located in the C drive. By default, the installation folder is “C:\Program Files\MongoDB\Server\{version}”.</li><li>Add the path to the MongoDB shell folder to the system environment variables, following the same steps mentioned in Step 3.</li></ol><p><strong>Step 8: Connect to the MongoDB Server with MongoDB Shell</strong></p><ol><li>Open a new command prompt window.</li><li>Run the following command to connect to the MongoDB server using MongoDB shell:</li></ol><pre>mongosh</pre><ul><li>The MongoDB shell should start and automatically connect to the running MongoDB server.</li><li>Note: Do not close the command prompt window running the MongoDB server (mongod) to maintain the connection between the server and the shell.</li></ul><p>Congratulations! You have successfully installed MongoDB and connected to the MongoDB server using the MongoDB shell.</p><p>If you encounter any issues during the installation or have further questions, you can refer to my Stack Overflow answer here:</p><ul><li><a href="https://stackoverflow.com/questions/51224959/mongo-is-not-recognized-as-an-internal-or-external-command-operable-program-o/76374625#76374625">https://stackoverflow.com/questions/51224959/mongo-is-not-recognized-as-an-internal-or-external-command-operable-program-o/76374625#76374625</a></li></ul><p>In this blog post, we covered the basics of MongoDB and provided a detailed installation guide. MongoDB offers a flexible and scalable solution for managing your data, and with the proper setup, you can start building applications that leverage the power of MongoDB.</p><p><strong>Who Am I?<br></strong>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Thank you</strong> so much for reading my blog🙂.</p><p>Happy coding with MongoDB!</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=29953e33187" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/mongodb-made-easy-installation-and-basics-unveiled-29953e33187">MongoDB Made Easy: Installation and Basics Unveiled</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Embarking on the Cybersecurity Journey: A Beginner’s Guide]]></title>
            <link>https://medium.com/techsoftware/embarking-on-the-cybersecurity-journey-a-beginners-guide-b42258f68482?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/b42258f68482</guid>
            <category><![CDATA[technology]]></category>
            <category><![CDATA[cybersecurity]]></category>
            <category><![CDATA[hacking]]></category>
            <category><![CDATA[security]]></category>
            <category><![CDATA[infosec]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Tue, 30 May 2023 06:15:48 GMT</pubDate>
            <atom:updated>2023-05-30T06:15:36.547Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1000/0*dHqyZXhO6DRHC8uh" /><figcaption>Photo by <a href="https://unsplash.com/@flyd2069?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">FLY:D</a> on <a href="https://unsplash.com/photos/C5pXRFEjq3w?utm_source=unsplash&amp;utm_medium=referral&amp;utm_content=creditCopyText">Unsplash</a></figcaption></figure><p>Hey everyone! 👋</p><p>Today, I took the plunge and decided to pursue the Complete Cybersecurity Bootcamp, which is part of the exciting Ethical Hacker &amp; Cybersecurity Expert Career Path. I’ve already gained some basic knowledge, and I can’t wait to share what I’ve learned so far in a fun and beginner-friendly way!</p><p><strong>What is Cyber Security?</strong><br>Imagine you have a super-secret diary with a lock on it, and you want to make sure nobody can read your secrets. That’s exactly what Cybersecurity is about, but instead of a diary, we’re protecting computers and networks from bad guys who want to peek into our digital lives.</p><p><strong>Cyber Security Prerequisites:</strong><br>1. Networking Basics: Think of it as understanding how the internet works — like knowing the difference between a modem and a router. It’s like being a wizard who can cast spells to make the internet run smoothly.<br>2. OS Knowledge: You need to be familiar with at least one of the three operating systems — Windows, macOS, or Linux. It’s like choosing your superhero costume — each has its own unique powers.<br>3. Certifications (Optional): These are like achievement badges that showcase your skills and boost your profile. They include <a href="https://www.comptia.org/certifications/network">Network+</a>, <a href="https://www.comptia.org/certifications/security">Security+</a>, and <a href="https://en.wikipedia.org/wiki/Certified_ethical_hacker">Certified Ethical Hacker</a>. Think of them as medals that prove you’re a cybersecurity champ!<br>4. Programming: Imagine you’re solving puzzles using a special language that computers understand. That’s what programming is! You don’t have to be a genius, just curious and willing to learn.<br>5. Tools: In the course, we’ll explore various tools that help us fight cyber threats. They’re like cool gadgets in a spy movie — except instead of lasers and grappling hooks, we have firewalls and encryption software.</p><p><strong>Cyber Security Career Paths:</strong><br>1. Security Engineers: They’re the guardians of digital fortresses, setting up defences and keeping the bad guys out.<br>2. Security Architects: Picture them as the architects of a secure kingdom, designing and building strong defences to protect valuable information.<br>3. Incident Responders: When trouble strikes, they’re like cyber firefighters, rushing in to save the day and investigate security breaches.<br>4. Security Consultants: They’re like cybersecurity doctors, diagnosing vulnerabilities and prescribing solutions to keep organizations safe. There’s even a Freelance Consulting ZTM Course (link at the end of the blog) that can help us become cybersecurity consultants!<br>5. Ethical Hackers/Penetration Testers: They use their skills for good, breaking into systems to identify weaknesses and help organizations strengthen their defences. They’re the Sherlock Holmes of the cybersecurity world.</p><p><strong>Cyber Security History:</strong><br>If you’re curious about how this exciting field came to be, check out these resources to explore its fascinating history and learn more about approaching the Cyber Security field:</p><ul><li>Short History of Cyber Security - <a href="https://cyber-security.degree/resources/history-of-cyber-security/">https://cyber-security.degree/resources/history-of-cyber-security/</a></li><li>Cyber Security Roles - <a href="https://www.geeksforgeeks.org/different-job-roles-in-cyber-security/">https://www.geeksforgeeks.org/different-job-roles-in-cyber-security/</a></li><li>How to Approach the Cyber Security field - <a href="https://cybersecurityguide.org/resources/cybersecurity-jobs/">https://cybersecurityguide.org/resources/cybersecurity-jobs/</a></li></ul><p>Remember, this is just the beginning of our cybersecurity journey! Let’s have fun, learn together, and become the digital defenders of tomorrow.</p><p><strong>Who Am I?<br></strong>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Join me to learn Cyber Security!<br></strong>Checkout the <a href="https://medium.com/techsoftware/javascript/home"><strong>TechSoftware’s Security Feature Page</strong></a> where my mission is to share my knowledge on Security concepts like Cyber Security and Hacking: <a href="https://medium.com/techsoftware/security/home">https://medium.com/techsoftware/security/home</a></p><p><strong>Resources:</strong><br>Learn what I know about Cyber Security from my favourite knowledge sources:</p><ul><li><a href="https://medium.com/techsoftware/ethical-hacker-cybersecurity-expert-career-path-4e4e8b50424">Ethical Hacker &amp; Cybersecurity Expert Career Path</a></li><li><a href="https://medium.com/techsoftware/complete-cybersecurity-bootcamp-334b762183c8">Complete Cybersecurity Bootcamp</a> (Course)</li><li><a href="https://medium.com/techsoftware/complete-ethical-hacking-bootcamp-ade1bb93da4c">Complete Ethical Hacking Bootcamp</a> (Course)</li><li><a href="https://academy.zerotomastery.io/a/aff_q8m9d6bb/external?affcode=441520_dcwk-s8s">Freelance Consulting ZTM Course</a> (Zero To Mastery Academy)</li><li><a href="https://academy.zerotomastery.io/a/aff_fvgz1fnn/external?affcode=441520_dcwk-s8s">Zero To Mastery (ZTM) Academy</a></li></ul><p><strong>Thank you</strong> so much for reading my blog🙂.</p><p>Happy hacking! 🕵️‍♀️🔒</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=b42258f68482" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/embarking-on-the-cybersecurity-journey-a-beginners-guide-b42258f68482">Embarking on the Cybersecurity Journey: A Beginner’s Guide</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
        <item>
            <title><![CDATA[Mastering JavaScript Data Types: Unveiling the Magic! ✨]]></title>
            <link>https://medium.com/techsoftware/mastering-javascript-data-types-unveiling-the-magic-c6efc3252f88?source=rss----7614c2ea6c33---4</link>
            <guid isPermaLink="false">https://medium.com/p/c6efc3252f88</guid>
            <category><![CDATA[software-development]]></category>
            <category><![CDATA[web-development]]></category>
            <category><![CDATA[programming]]></category>
            <category><![CDATA[javascript]]></category>
            <category><![CDATA[technology]]></category>
            <dc:creator><![CDATA[Aswin Barath]]></dc:creator>
            <pubDate>Sat, 27 May 2023 13:17:50 GMT</pubDate>
            <atom:updated>2023-06-01T04:59:52.466Z</atom:updated>
            <content:encoded><![CDATA[<figure><img alt="" src="https://cdn-images-1.medium.com/max/1024/1*kYoAT-SA9P_2159Sollf6A.png" /><figcaption>Design by <a href="https://medium.com/@aswinbarath">Aswin Barath</a></figcaption></figure><p>Welcome, fellow adventurers, to the enchanting world of JavaScript! 🎉</p><p>As you embark on your coding journey, understanding the fundamental building blocks of any programming language is essential. In this comprehensive and beginner-friendly guide, we’ll unravel the mysteries of data types in JavaScript.</p><p>From primitive data types like numbers, booleans, strings, null, undefined, symbols, and BigInt, to exploring exponential notation and the mighty typeof operator, we’ll equip you with the tools to wield JavaScript’s magic. We’ll also delve into advanced data types, or as they are often called, “data structures,” such as arrays, objects, maps, and more.</p><p>So, fasten your seatbelts, embrace the wonders of JavaScript, and let the coding adventure begin! 💫</p><p><strong>Primitive Data Types: Unveiling the Essentials 🏗️</strong></p><p><strong>1. Numbers:</strong></p><p>Numbers are the building blocks of mathematical operations and calculations.</p><pre>let age = 42;<br>let pi = 3.14;</pre><p><strong>2. Boolean:</strong></p><p>Booleans have two values: true or false, guiding the flow of your program.</p><pre>let isCodingFun = true;<br>let isCodingChallenging = false;</pre><p><strong>3. Strings:</strong></p><p>Strings empower you to work with textual data, allowing communication, message display, and text manipulation.</p><pre>let name = &quot;JavaScript&quot;;<br>let greeting = &#39;Hello, world!&#39;;</pre><p><strong>4. Null:</strong></p><p>Null signifies the intentional absence of a value.</p><pre>let emptyBox = null;</pre><p><strong>5. Undefined:</strong></p><p>Undefined occurs when a variable is declared but not assigned a value.</p><pre>let country; // undefined</pre><p><strong>6. Symbol:</strong></p><p>Symbols are unique and immutable values used as special identifiers, often creating unique property keys.</p><pre>const id = Symbol(&#39;id&#39;);<br>const user = {<br>  [id]: &#39;abc123&#39;,<br>  name: &#39;John Doe&#39;<br>};</pre><p><strong>7. BigInt:</strong></p><p>BigInt is used when dealing with truly massive numbers beyond the limits of regular numbers, allowing precise arithmetic operations.</p><pre>const bigNumber = 123456789012345678901234567890n;<br>console.log(bigNumber); // Output: 123456789012345678901234567890n</pre><p><strong>Exponential Notation: Embracing the Power of Scale ✨</strong></p><p>JavaScript allows expressing numbers using exponential notation, making it easy to represent extremely large or small values.</p><pre>const million = 1e6; // 1,000,000<br>const billionth = 1e-9; // 0.000000001</pre><p><strong>typeof Operator: Peering into the Unknown 🎭</strong></p><p>The typeof operator helps understand the nature of variables, unveiling the true identity of data types.</p><pre>const age = 42;<br>console.log(typeof age); // Output: &quot;number&quot;<br>const name = &quot;JavaScript&quot;;<br>console.log(typeof name); // Output: &quot;string&quot;<br>const isCodingFun = true;<br>console.log(typeof isCodingFun); // Output: &quot;boolean&quot;</pre><p><strong>Advanced-Data Types as Data Structures: Unleashing the Power 💪</strong></p><ol><li><strong>Arrays:</strong></li></ol><p>Arrays are versatile and powerful data structures that hold multiple values, allowing efficient storage and access to elements.</p><pre>const fruits = [&#39;apple&#39;, &#39;banana&#39;, &#39;orange&#39;];<br>console.log(fruits[0]); // Output: &quot;apple&quot;</pre><p><strong>2. Objects:</strong></p><p>Objects represent real-world entities and store collections of key-value pairs, modelling complex relationships.</p><pre>const person = {<br>  name: &#39;Alice&#39;,<br>  age: 25,<br>  isStudent: true<br>};<br>console.log(person.name); // Output: &quot;Alice&quot;</pre><p><strong>3. Maps:</strong></p><p>Maps provide an advanced way of organizing data by associating keys with values, offering flexibility and efficient key-value pair retrieval.</p><pre>const userMap = new Map();<br>userMap.set(&#39;name&#39;, &#39;John&#39;);<br>userMap.set(&#39;age&#39;, 30);<br>console.log(userMap.get(&#39;name&#39;)); // Output: &quot;John&quot;</pre><p><strong>Data Structures — Empowering Your Code 🏰</strong></p><p>In JavaScript, advanced data types such as arrays, objects, and maps can also be referred to as data structures. These structures empower you to organize and manipulate more complex information efficiently.</p><p><strong>Conclusion: Embrace the Magic of JavaScript Data Types! 🌈</strong></p><p>Congratulations, brave coding adventurer! You’ve now journeyed through the captivating landscape of JavaScript data types. We explored primitive data types, including numbers, booleans, strings, null, undefined, symbols, and BigInt. We also delved into exponential notation, peered into the unknown with the typeof operator, and unleashed the power of advanced data types or data structures, including arrays, objects, and maps.</p><p>Armed with this newfound knowledge, you’re ready to wield the magic of JavaScript and create wonders with your code! Understanding data types is crucial for crafting robust applications, and this is just the beginning of your coding odyssey. So, keep exploring, experimenting, and let your creativity soar high in the boundless realms of JavaScript!</p><p>May your code be enchanting, and your journey ever-thrilling! Happy coding! 🚀</p><p><strong>Who Am I?</strong></p><p>I’m Aswin Barath, a Software Engineering Nerd who loves building Web Applications, now sharing my knowledge through <a href="https://medium.com/techsoftware">Blogging</a> during the busy time of my freelancing work life. Here’s the link to all of my craziness categorized by platforms under one place: <a href="https://linktr.ee/AswinBarath">https://linktr.ee/AswinBarath</a></p><p><strong>Join me to learn JavaScript!</strong></p><p>Checkout the <a href="https://medium.com/techsoftware/javascript/home"><strong>TechSoftware Feature Page</strong></a> where my mission is to share my knowledge on JavaScript: <a href="https://medium.com/techsoftware/javascript/home">https://medium.com/techsoftware/javascript/home</a></p><p>Learn what I know about JavaScript from any of my favourite knowledge sources:</p><ul><li>Mozilla Developer Network (MDN): <a href="https://developer.mozilla.org/en-US/docs/Web/JavaScript/Data_structures">JavaScript Data Types and Structures</a></li><li>W3Schools: <a href="https://www.w3schools.com/js/js_datatypes.asp">JavaScript Data Types</a></li><li>JavaScript.info: <a href="https://javascript.info/types">Data Types</a></li><li><a href="https://medium.com/techsoftware/the-complete-web-developer-in-2022-zero-to-mastery-40b009305c6?source=friends_link&amp;sk=4dbac18b2574292b479ae3ca545666e9">Complete Web Developer Course</a></li><li><a href="https://medium.com/techsoftware/course-review-the-complete-junior-to-senior-web-developer-roadmap-2022-b1dd7061797?source=friends_link&amp;sk=da2293918883104611c14ff4a9bc7d4d">Junior to Senior Developer Course</a></li><li><a href="https://medium.com/techsoftware/top-5-javascript-courses-on-udemy-is-it-worth-it-68bd8b85fbe4">Top 5 JavaScript Courses on Udemy</a></li><li><a href="https://youtu.be/ry8i5Qam7RI">JavaScript Roadmap — The Basics: Event Recording</a></li></ul><p><strong>Thank you</strong> so much for reading my blog🙂.</p><img src="https://medium.com/_/stat?event=post.clientViewed&referrerSource=full_rss&postId=c6efc3252f88" width="1" height="1" alt=""><hr><p><a href="https://medium.com/techsoftware/mastering-javascript-data-types-unveiling-the-magic-c6efc3252f88">Mastering JavaScript Data Types: Unveiling the Magic! ✨</a> was originally published in <a href="https://medium.com/techsoftware">TechSoftware</a> on Medium, where people are continuing the conversation by highlighting and responding to this story.</p>]]></content:encoded>
        </item>
    </channel>
</rss>