teleren/devto huggingface dataset:
Solving "Binary Tree Level Order Traversal" Leet code Question
Tags: java, programming, discuss, coding
Published: 2023-09-13 07:06:45

## Leet code Question no: 102

**Companies asked this Question:**
_Company: no of times_
Amazon 2
Bloomberg 11
Uber 2
Apple 2
LinkedIn 25
Microsoft 13
Facebook 12
Oracle 7
Google 5
ServiceNow 3
Splunk 2
Adobe 2
Docusign 2
Accolite 2
TikTok 2

## Intuition
We aim to perform a level-order traversal of a binary tree, collecting nodes at each level into sublists.

## Approach
1. Utilize a queue for level-order traversal, initializing an empty list `WrapList` to store results.
2. While the queue is not empty, dequeue nodes, collect their values into sublists, and enqueue their children.
3. Add sublists to `WrapList` as levels are processed and return it as the result.


## Complexity
- Time complexity: O(n) - We visit each node once during the traversal.
- Space complexity: O(n) - The space usage grows with the number of nodes due to the queue and the result list.

## Code

```

/**
 * Definition for a binary tree node.
 * public class TreeNode {
 *     int val;
 *     TreeNode left;
 *     TreeNode right;
 *     TreeNode() {}
 *     TreeNode(int val) { this.val = val; }
 *     TreeNode(int val, TreeNode left, TreeNode right) {
 *         this.val = val;
 *         this.left = left;
 *         this.right = right;
 *     }
 * }
 */
class Solution {
    public List<List<Integer>> levelOrder(TreeNode root) {
        List<List<Integer>> WrapList = new LinkedList<>();

        if(root == null)
            return WrapList;

        Queue<TreeNode> queue =  new LinkedList<>();
        queue.offer(root);

        while(!queue.isEmpty()){
            int levelNum = queue.size();
            List<Integer> subList = new LinkedList<>();

            for(int i = 0 ;  i < levelNum ; i++){
                TreeNode node = queue.poll();
                subList.add(node.val);

                if(node.left != null) queue.offer(node.left);
                if(node.right != null) queue.offer(node.right);
            }

            WrapList.add(subList);
        }

        return WrapList;
    }
}
```

Happy coding,
shiva
Neovim Remap Esc Button
Tags: neovim, keyboard, programming, vim
Published: 2023-09-13 07:01:52

Dalam Neovim, untuk bertukar dari mode Insert ke mode Normal, perlu tekan butang Esc. 

Masalah dengan keyboard ini adalah kita perlu tekan butang Fn serta butang Esc untuk keluar dari mode Insert. 
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/v3g2q57a28pnh4aiyewh.PNG)

Cara paling senang adalah tambah fungsi atau remap fungsi butang Esc ke key yang lain. 

aku pakai lua plugin, dalam keybinding.lua, kita letak 

```
vim.keymap.set("i","jj","<Esc">,options)
```


jadi, untuk keluar dari mode Insert, boleh tekan butang jj. 

 [Google Translate](https://dev-to.translate.goog/hardyweb/neovim-remap-esc-button-24jg?_x_tr_sl=auto&_x_tr_tl=en&_x_tr_hl=en&_x_tr_pto=wapp)
#neovim #vim 
<a href="https://www.buymeacoffee.com/hardyweb" target="_blank"><img src="https://cdn.buymeacoffee.com/buttons/default-orange.png" alt="Buy Me A Coffee" height="41" width="174"></a>
Mastering the Art of Flash Card Study: A Fun and Effective Learning Technique
Published: 2023-09-13 07:00:21

Flash cards are simple tools that can be created using paper and pen or digitally through software like PowerPoint. They offer a dynamic and engaging way to learn, making the process not only efficient but also enjoyable. In this blog post, we will explore how to use flash cards effectively for studying and why they are a valuable addition to your study routine.

Creating Flash Cards

1. **Choose Your Format:** Flash cards can be made on paper or digitally using software like PowerPoint. Both methods have their advantages. Paper cards are tactile and can be carried anywhere, while digital cards offer the convenience of easy access and customization.

2. **Question and Answer:** The fundamental principle of a flash card is to have a question on one side and the answer on the other. Keep your questions clear and concise.

3. **Utilize PowerPoint:** If you're using PowerPoint, create a default slide layout where you put the question in the title field and the answer in the text field. To enhance the learning experience, you can animate the slides so that the question appears first and then reveal the answer when you're ready.

The Benefits of Flash Card Study

1. **Active Learning:** Flash cards turn passive reading into an active learning experience. Instead of passively reading through pages of text, you engage with the material by recalling and testing your knowledge.

2. **Enhanced Memorization:** Flash cards are particularly effective for memorizing essential facts and concepts. For instance, questions like "How do we represent pseudo-classes in CSS?" are ideal for flash cards. You don't need to include all the intricate details; the goal is to capture the basics.

3. **Spaced Repetition:** Revisiting flash cards at intervals helps reinforce your memory. It leverages the concept of spaced repetition, which optimizes learning by reviewing material at increasing intervals over time. This method improves long-term retention.

4. **Focus on Outlines:** While learning, it's essential to understand the fundamental concepts. Flash cards can help you remember the outlines of what you've studied, even if you forget the finer details. This ability to recall the basics is valuable when tackling complex subjects.

Conclusion

Incorporating flash cards into your study routine can make the learning process more enjoyable and efficient. They promote active learning, enhance memorization of essential facts, and leverage spaced repetition to improve retention. Remember that the main purpose of flash cards is to capture basic facts and outlines. Understanding the fundamental concepts and allowing your brain to forget them, only to revisit and relearn them, is a powerful technique for long-term retention.

So, whether you're a student preparing for exams or someone looking to expand your knowledge, consider incorporating flash cards into your learning toolkit. They're a simple yet effective way to make your study sessions more engaging and productive. Happy learning!
How Do You Create Inclusive Workplaces?
Tags: discuss
Published: 2023-09-13 07:00:00

_Welcome to Code Chatter, your go-to series for conversational coding insights. What makes this series of questions different from all the others? Well, truth be told, not much, but they're still thought-provoking and fun. Join us as we explore the coding world, one witty question at a time._

> What advice would you offer to companies looking to create more inclusive workplaces for women, non-white, or disabled individuals in the tech industry?
Follow the DEVteam for more discussions and online camaraderie!

{% embed [https://dev.to/devteam](https://dev.to/devteam) %}
Silver Screen Code: What's Your Job's Movie Genre?
Tags: discuss, beginners, codenewbie
Published: 2023-09-13 07:00:00

_Get a glimpse into the daily experiences, work routines, and unique perspectives of tech professionals, both novice and experienced alike, in "A Day in the Life."_

> If your job was a movie, what genre would it be? For bonus points: what's the title?


Follow the [CodeNewbie Org](https://dev.to/codenewbieteam) and [#codenewbie](https://dev.to/t/codenewbie) for more discussions and online camaraderie!

*{% embed* https://dev.to/codenewbieteam *%}*
Understanding the Core Components of a Network
Tags: ccna, cisco, course, network
Published: 2023-09-13 06:58:10

**Introduction:**  
Diving into the world of networking can be overwhelming, especially when you're trying to grasp the myriad of components that make up a network. In this post, we'll break down the essential elements of a network and their roles to give you a clearer understanding.

---

**1. Endpoints and Servers:**  
- **Endpoints:** These are devices that users interact with directly on a network, such as workstations, laptops, tablets, and smartphones. They are the "end" points of a network where users send and receive data.
  
- **Servers:** Unlike endpoints, servers don't require direct human interaction. They can be both hardware components with more resources and software that runs specific tasks. Servers handle requests from endpoints, like sending emails or accessing files.

---

**2. Wireless Networks:**  
To set up a wireless network, you need:
- **Endpoints:** Devices like laptops, tablets, and smartphones that will connect to the network.
- **Access Points (APs):** These are devices that broadcast the wireless signal. Interestingly, APs are wired into the main network but provide wireless connectivity to endpoints.

---

**3. Switches and Routers:**  
- **Switches (Layer 2 & Layer 3):** These devices connect various components within a network. While Layer 2 switches only handle switching, Layer 3 switches can manage both routing and switching.
  
- **Routers:** These devices connect different networks. They route data packets between networks based on IP addresses.

---

**4. Firewalls:**  
A crucial component for network security, firewalls filter incoming and outgoing network traffic. They can permit or deny specific data packets based on a set of security rules, ensuring that harmful data doesn't enter the network.

---

**5. Controllers:**  
Controllers, like the DNA Center, provide a centralized point of management for networks. They offer visibility into all network components and can be used to manage and configure devices, ensuring the network runs smoothly.

---

**Conclusion:**  
While not all networks will have every component mentioned, understanding these basics is crucial for anyone diving into networking. As networks grow in complexity, a well-rounded knowledge of these components will be invaluable.

---

**Call to Action:**  
Ready to dive deeper into networking? Stay tuned for more insights and tips on mastering the world of networks! 🌐
Everything About Open Source Projects That You Need To Know.
Tags: beginners, webdev, opensource, discuss
Published: 2023-09-13 06:54:44

Starting an open-source project or contributing to an existing one is a rewarding endeavor that can improve your programming skills, build your professional network, and provide solutions to problems for the wider developer community. Here's a step-by-step guide on how to get started:

**1. Identify a Problem or Interest**
Before starting or choosing an open-source project, it's crucial to identify a problem you want to solve or an interest you're passionate about. This could be anything from a tool you wish existed, a feature you think would improve an existing project, or a bug you want to fix

**2. Choose a Project**

If you're contributing to an existing project, choose one that you use and love. It's also important to ensure that the project is active, with recent commits and responsive maintainers



**3. Know the Project**
Get to know the project by reading its documentation, understanding its features, and familiarizing yourself with its codebase. This will help you understand what the project does and how it can be improved


**4. Make a Contribution**
Contributing to an open-source project can come in many forms, from code contributions to non-code contributions like graphic design, project management, testing, bug reports, documentation, and community management. Regardless of your skill level, there are opportunities for you to contribute




**5. Start Your Own Project**

If you're starting your own open-source project, there's no perfect time to do so. You can open source an idea, a work in progress, or after years of being closed source. However, you should feel comfortable having others view and give feedback on your work. Also, ensure to include necessary documentation and an open-source license to protect your work and allow others to contribute



**6. Build a Community**
Creating an open-source project is not just about the code; it's also about building a community that encourages people to use, contribute to, and evangelize your project


 contributing to open source is not just about helping others; it's also about improving your skills and gaining experience in the process. As you continue contributing or managing your project, you'll learn valuable lessons about software development, project management, and collaboration.
What is SWOT analysis in Business Analyst?
Tags: beginners
Published: 2023-09-13 06:50:14

SWOT analysis is a strategic planning tool frequently used by business analysts to assess the internal and external factors affecting an organization. The acronym SWOT stands for Strengths, Weaknesses, Opportunities, and Threats, representing the four categories of factors that are evaluated during the analysis.

1. **Strengths:** These are the internal attributes and resources that give an organization a competitive advantage or distinctive capabilities. Strengths can include a strong brand, talented workforce, efficient processes, proprietary technology, or a loyal customer base. Business analysts identify strengths to help organizations leverage their advantages effectively.

2. **Weaknesses:** Weaknesses are internal factors that hinder an organization's performance or competitive positioning. Common weaknesses might include outdated technology, inefficient processes, lack of skilled personnel, or financial constraints. Identifying weaknesses is crucial for organizations to address and mitigate these issues.

3. **Opportunities:** Opportunities represent external factors or trends that an organization can capitalize on to achieve its objectives and improve its position. These can include emerging markets, changing consumer preferences, technological advancements, or new partnerships. Business analysts help organizations identify and prioritize opportunities for growth and development.

4. **Threats:** Threats are external factors or challenges that can negatively impact an organization's performance and competitiveness. Examples of threats include market competition, economic downturns, regulatory changes, or natural disasters. Business analysts assess threats to develop strategies for risk mitigation and resilience.

The SWOT analysis process involves gathering and analyzing data, often through research, interviews, and data collection methods. Once the analysis is complete, business analysts work with stakeholders to develop strategies and action plans that leverage strengths, mitigate weaknesses, seize opportunities, and address threats. Apart from it by obtaining [Business Analyst Certification](https://www.edureka.co/masters-program/business-analyst-certification-course), you can advance your career as Business Analyst. With this course, you can demonstrate your expertise in designing and implementing data modelling, data preparation, data analysis, querying data, data visualisation, and many more.
 
SWOT analysis serves as a valuable framework for strategic decision-making, helping organizations align their resources and efforts with their goals and the changing business environment. It provides a comprehensive view of the organization's current state and the factors that can influence its future, enabling business analysts to provide actionable recommendations for improvement and growth.
Linux Command Line: A Comprehensive Guide for me.
Tags: linux, cli
Published: 2023-09-13 06:44:35



![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w7vm22jn69vgxjsct9zd.png)Linux is a powerful and widely used open-source operating system renowned for its stability, security, and flexibility. I am learning Linux Commands. If I see any command that is important or most frequently used, then I will add the command and description to the blog.

> 

## **File and Folder Management:**

> ls
 - List Files and Directories:

example: Listing the contents of your home directory.

```
ls ~
```

> cd
 - Change Directory:

example: Moving into the Documents directory.

```
cd ~/Documents
```

> touch
 - Create Empty Files:

example: Creating a new text file named "example.txt."

```
touch example.txt
```

> mkdir
 - Create Directories:

example: Creating a directory named "projects."

```
mkdir projects
```

> cp 
- Copy Files and Directories:

example: Copying a file from one directory to another.

```
cp file.txt /path/to/destination/
```

> mv
 - Move/Rename Files and Directories:

example: Renaming a file.

```
mv oldfile.txt newfile.txt
```

> rm 
- Remove Files and Directories:

example: Deleting a file.

```
rm unwantedfile.txt
```

## **File Permissions:**

> chmod
 - Change File Permissions:

example: Making a script executable.


```
chmod +x myscript.sh
```

> chown
 - Change File Ownership:

example: Changing the owner of a file.


```
chown newowner:groupname myfile.txt
```

## **User and Group Management:**

> useradd 
- Add Users:

example: Adding a new user named "johndoe."


```
sudo useradd johndoe
```

> userdel
 - Delete Users:

example: Removing the user "johndoe."


```
sudo userdel johndoe
```

> passwd 
- Change User Passwords:

example: Changing the password for the user "johndoe."


```
sudo passwd johndoe
```

> groupadd 
- Create Groups:

example: Creating a group named "developers."


```
sudo groupadd developers
```

> groupdel
 - Delete Groups:

example: Removing the group "developers."


```
sudo groupdel developers
```

> usermod
 - Modify User Attributes:

example: Adding a user to the "developers" group.


```
sudo usermod -aG developers johndoe
```
RETRO COOL FONTS
Published: 2023-09-13 06:40:06

Retro cool fonts find a versatile and captivating utility across a spectrum of creative domains, injecting a sense of nostalgia and uniqueness that captivates audiences. These fonts, reminiscent of bygone eras, carve a distinct visual identity that can be employed in various contexts to evoke specific emotions and narratives. In graphic design, they are powerful tools to convey vintage aesthetics, ideally suited for projects aiming to produce a sense of timelessness, whether for posters, album covers, or branding materials.
**[Website](https://storysseed.blogspot.com/retro-cool-fonts)**
Security flaw: Greenshot
Tags: security, cybersecurity, shortupdate
Published: 2023-09-13 06:24:03

I've always used the handy application Greenshot extensively for taking screenshots, but I've recently been alerted that it contains a potential [security vulnerability](https://www.redpacketsecurity.com/greenshot-code-execution-cve-2023-34634/). Worse, the app itself is no longer under development, so an official fix isn't expected. It's open source so maybe the community will fork it and bring out a new version, but for now, I've sadly uninstalled it. Farewell, friend, you've served me well! Snipping tool is just not the same :(
Getting Started with the React Numeric Textbox Component
Tags: webdev, react
Published: 2023-09-13 06:20:10

Learn how to create and configure the Syncfusion React Numeric Textbox component in a React application using Visual Studio Code. The Numeric TextBox component receives number inputs from users, offering step-by-step adjustments and valuable features like number format support, precision control, and spin buttons. 

In this video, you will see how to add the numeric textbox component to an app with a few of its basic features: range validation, value formatting, and setting decimal precision. The Numeric TextBox empowers users to input numeric values, encompassing both integers and decimals, through a text-based format. It grants you the flexibility to create custom formatting rules, tailoring how numeric values are displayed to align with your application's specific needs. 

This encompasses fine-tuning the number of decimal places, incorporating currency symbols, and introducing thousands of separators. Moreover, you have the capability to establish minimum and maximum value constraints, effectively limiting input to a predefined range. Typically, the Numeric TextBox is equipped with convenient increment and decrement buttons that facilitate value adjustment in specified increments or decrements. It also offers robust support for custom validation, ensuring that user input aligns with your application's criteria by enabling you to define and enforce rules to prevent erroneous entries. 

The component extends the capability to respond to a diverse array of events triggered by user interactions, including value changes, focus adjustments, and blur actions, allowing you to implement responsive behaviors. Users can efficiently and accessibly navigate and interact with the Numeric TextBox using keyboard shortcuts, enhancing both efficiency and accessibility. Additionally, the component may provide localization support, enabling you to dynamically display numeric values in different formats based on the user's locale. 

Finally, you can seamlessly integrate the Numeric TextBox into your application's design by customizing its appearance, encompassing size, color schemes, and layout, ensuring a harmonious fit with your application's overall aesthetic. 

**Product overview:** https://www.syncfusion.com/react-components/react-numeric-textbox

**Tutorial video:** https://www.syncfusion.com/tutorial-videos

**Download the example from GitHub:** https://github.com/SyncfusionExamples/getting-started-with-the-react-numeric-textbox-component

{% youtube CCcvKHTlydI %}
Tricky Javascript Interview Questions ( Hoisting ) - Scoping, Shadowing, ( Var, Let, Const ) & more
Tags: javascript, frontend, tutorial, webdev
Published: 2023-09-13 06:18:35

Preparing for a JavaScript interview? 🧐 Dive deep into the world of hoisting with The information shared in this video and solve challenging questions that interviewers frequently throw your way. In this comprehensive video, I will unravel the mysteries of hoisting, explore scoping and shadowing intricacies, and decipher the differences between 'var,' 'let,' and 'const.'

🔍 Key Topics Explored:
📌 Demystifying Hoisting in JavaScript
📌 Navigating Scoping and Shadowing
📌 Mastering 'Var,' 'Let,' and 'Const' Declarations

Get ready to supercharge your JavaScript interview preparation! 🚀 Don't forget to like, subscribe, and hit the notification bell to stay updated on our latest tutorials and interview tips.

{% embed https://www.youtube.com/watch?v=U68MgTliPb0 %}