teleren/devto huggingface dataset:
Machine Learning vs Deep Learning
Tags: ai, machinelearning, deeplearning, computerscience
Published: 2022-06-15 02:55:44

Hello, everyone. Hope you are doing well.
This is my first post in AI. I wanna say about differences between Machine Learning and Deep Learning which are mostly buzzwords in recent AI.

_To most people, the terms deep learning and machine learning seem like interchangeable buzzwords of the AI world. However, that’s not true._

**What are the difference between Machine Learning and Deep Learning?**

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/pjgnseqy6c8mqmcnnd2i.jpg)

To break it down in a single sentence: Deep Learning is a specialized subset of Machine Learning which, in turn, is a subset of artificial intelligence. Let’s deep into more details. 


**Definition**

What is Machine Learning?
_An application of artificial intelligence that includes algorithms that parse data, learn from the data, and then apply what they’re learned to make informed decisions._

- Supervised Learning
- Unsupervised Learning
- Reinforcement Learning

What is Deep Learning?
_A subfield of machine learning that structures algorithms in layers to create an “Artificial Neural Network (ANN)” that can learn and make intelligent decisions on its own._

- Convolutional Neural Networks (CNN)
- Recurrent Neural Networks (RNN)



**5 key differences between Machine Learning and Deep Learning**

1. Human Intervention
Machine Learning requires more ongoing human intervention to get results. Deep Learning is more complex to set up but requires minimal intervention thereafter
2. Hardware
Machine Learning programs tend to be less complex than Deep Learning algorithms and can often run on conventional computers. But Deep Learning system require far more powerful hardware and resources.
3. Time
Machine Learning can take as little time as a few seconds to a few hours, whereas Deep Learning can take a few hours to a few weeks or more.
4. Approach
Machine Learning tends to require structured data and used traditional algorithms like linear regression. Deep Learning employs neural networks and is built to accommodate large volumes of unstructured data.
5. Applications
Machine Learning is already in use in your email box, bank, and doctor’s office. These are maybe such simple tasks.
Deep Learning technology enables more complex and autonomous programs, like self-driving cars or robots that perform advanced surgery.


![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/vup3on7q1cw6780oyuyh.png)


Thanks for reading my first post carefully.
To encourage me continue work, please follow me on Dev.to and Github.

https://dev.to/levintech
https://github.com/levintech


Best Regards.
Snowflake network, a feature-rich multisig and automation platform for the Solana community
Published: 2022-06-15 02:52:58

Hello folks,
I’d love to introduce Snowflake network, a feature-rich multisig and automation platform for the Solana community:
- Multisig Platform: safe.snowflake.so
- Automation Platform: app.snowflake.so

Think of this as the Gnosis Safe of Solana. We’ve spent months building our product, and since launching have collaborated with some of the largest protocols on Solana to onboard their operations onto Snowflake Safe. 

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s4x4fkshjbmoobjqvjz5.png)
A quick overview of the product below.
App: https://safe.snowflake.so
Twitter: https://twitter.com/snowflake_sol/status/1526905441057484800

Follow us now to get more information:
📌Website: https://snowflake.so/
📌Twitter:  https://twitter.com/snowflake_sol
📌Telegram: https://t.me/SnowflakeSo
📌Group chat: https://t.me/Snowflake_chat
Jual Gps Geodetic South Galaxy G1
Tags: gps, gpsgeodetic, southg1
Published: 2022-06-15 02:41:49

FITUR UTAMA:
* Platfrom Intelegent
* Dukungan konstelasi satelit penuh
* Modul Bluetooth dan fungsi NFC
* Modul data-link lanjutan

SPESIFIKASI:
1. Pelacakan Sinyal
* Saluran: 440 saluran
* GPS: L1, LI C / A, L2, L2C, L2P, L5
* BeiDou: B1, B2, B3
* GLONASS: L1, L1C / A, L1P, L2, L2C / A, L2P
* Galileo: E1, E5a, E5b
* SBAS: WAAS, EGNOS, MSAS, GAGAN
2. Fitur GNSS
* Start dingin: <50s
* Awal yang hangat: <45s
* Mulai panas: <15 detik
* Waktu Inisialisasi RTK: biasanya <10 detik
* Reacquistion sinyal: <1.5s
* Keandalan inisialisasi: biasanya> 99,9%
3. Pemosisian
* Survei Statistik GNSS: 2.5 mm + 0.5 ppm Horizontal; 5 mm + 0,5 ppm Vertikal
* Survei kinematik waktu nyata: 8 mm + 1ppm Horizontal; 15 mm + 1 ppm Vertikal
* E-RTK (<100km): 0.2m + 1 ppm Horizontal; 0.4m + 1 ppm Vertikal
* DGPS: <0,4 m 3D RMS
* SBAS: 1 m 3D RMS
* Standalone: ​​RMS 3D 1,5 m
4. Komunikasi
* Port I / O: 5-7 pin port daya eksternal LEMO + RS232; 7 pin LEMO USB; 1 port anntena link data jaringan / radio; Slot kartu SIM
5. Format Data
* Memori: 8 GB
6. Lingkungan
* Suhu kerja: -40C hingga + 80C
* Suhu penyimpanan: -55C hingga + 95C
* Kelembaban: 95% tanpa pertimbangan
* Tahan air: IP67
* Guncangan dan getaran: MIL-STD-810G
7. Listrik
* Waktu operasi:> 6 jam

Source : https://www.nurjamansurvey.com
Arranging Coins
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 02:30:41

You have `n` coins and you want to build a staircase with these coins. The staircase consists of `k` rows where the `ith` row has exactly `i` coins. The last row of the staircase **may be** incomplete.

Given the integer `n`, return _the number of **complete rows** of the staircase you will build_.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/04/09/arrangecoins1-grid.jpg)

**Input:** n = 5
**Output:** 2
**Explanation:** Because the 3rd row is incomplete, we return 2.

**Example 2:**

![](https://assets.leetcode.com/uploads/2021/04/09/arrangecoins2-grid.jpg)

**Input:** n = 8
**Output:** 3
**Explanation:** Because the 4th row is incomplete, we return 3.

**Constraints:**

*   `1 <= n <= 231 - 1`

**SOLUTION:**

    import math
    
    class Solution:
        def arrangeCoins(self, n: int) -> int:
            k = math.floor((math.sqrt(1 + 8 * n) - 1) / 2)
            return k
Setup Multiple SSH Key's
Tags: ssh, beginners
Published: 2022-06-15 02:22:51

Sometimes you will need to deal with multiple projects at the same time, some client with AWS, Gitlab, Github etc.
Here are some steps that could be helpful ;)

#### 1. Create a new SSH Key
ED25519
```
ssh-keygen -t ed25519 -C "<comment>"
```
RSA 2048
```
ssh-keygen -t rsa -b 2048 -C "<comment>"
```

#### 2. Add SSH Key
```
eval $(ssh-agent -s)
ssh-add <directory to private SSH key>
```

#### 3. Setup config
Touch or update the `config` file in `~/.ssh/`:
```
Host gitlab-scope
  HostName gitlab.com
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/gitlab_com_rsa
```
AWS Codecommit
```
Host aws-codecommit
  HostName git-codecommit.{region}.amazonaws.com
  User APKARF3PHVLQ1EXAMPLE
  PreferredAuthentications publickey
  IdentityFile ~/.ssh/private_key
  PubkeyAcceptedAlgorithms +ssh-rsa
  HostkeyAlgorithms +ssh-rsa
```

#### Hostnames
- Gitlab: `gitlab.com`
- Github: `github.com`
- AWS Codecommit: `git-codecommit.{region}.amazonaws.com`

#### 4. Setup public key
```
cat private_key.pub
```
```
ssh-ed25519 ABBBC3NzaC1lZDI1NTE5AAAAIBSFa3klpakF4ZkNPO7JWMsQDqy3Wd6ZvyPslt <comment>
```
Copy the key to your repository preferences and create the SSH key 

#### 5. Verify the connection
```
ssh -T git@gitlab-scope
```
```
The authenticity of host 'gitlab.com (172.0.0.1)' can't be established.
ECDSA key fingerprint is SHA256:hfksfbdfoerHKSDKFDFDFDF.
Are you sure you want to continue connecting (yes/no/[fingerprint])? yes
Warning: Permanently added 'gitlab.com,172.0.0.1' (ECDSA) to the list of known hosts.
Welcome to GitLab, @user!
```

#### 6. Clone the repository
```
git clone git@gitlab-scope:project/repository-name.git
```
AWS Codecommit
```
git clone ssh://aws-codecommit/v1/repos/repository-name
```
Building a dead simple Rating component without any dependencies
Tags: react, javascript, css
Published: 2022-06-15 02:18:17

Hello guys 👋 Today I want to share with you my solution to build a Rating component like the one bellow:

![rating component react](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/s7bp3lx5gcuv2opf5mpn.png)

This is a super simple component that has no interactivity functionality. It's just meant to display a rating. Initially I **thought about using a 3rd party lib but the ones I found are outdated and super heavy (>70kb)** for such a simple thing so I went ahead and built one myself.

## The code:
```jsx
import { useId } from "react";

const Star = ({ variant }: { variant: "filled" | "empty" | "half" }) => {
  const id = useId();

  let c1, c2;
  if (variant === "filled") {
    c1 = "#FBBC05";
    c2 = "#FBBC05";
  } else if (variant === "empty") {
    c1 = "#C4C4C4";
    c2 = "#C4C4C4";
  } else if (variant === "half") {
    c1 = "#FBBC05";
    c2 = "#C4C4C4";
  }

  return (
    <svg
      width="20"
      height="19"
      viewBox="0 0 20 19"
      fill="none"
      xmlns="http://www.w3.org/2000/svg"
    >
      <defs>
        <linearGradient id={id}>
          <stop offset="50%" stopColor={c1} />
          <stop offset="50%" stopColor={c2} />
        </linearGradient>
      </defs>
      <path
        d="M10 0.148438L12.935 6.14144L19.5 7.10844L14.75 11.7704L15.871 18.3564L10 15.2454L4.129 18.3564L5.25 11.7704L0.5 7.10844L7.064 6.14144L10 0.148438Z"
        fill={`url(#${id})`}
      />
    </svg>
  );
};

const Rating = ({ rating, max = 5 }: { rating: number; max?: number }) => {
  return (
    <div className="flex items-center">
      {Array.from({ length: Math.floor(rating) }, (_, i) => (
        <Star key={i} variant="filled" />
      ))}
      {!Number.isInteger(rating) && <Star variant="half" />}
      {Array.from({ length: max - Math.ceil(rating) }, (_, i) => (
        <Star key={i} variant="empty" />
      ))}
    </div>
  );
};

export default Rating;
```
🚨 Realize I'm using React 18 useId hook because the lineargradient svg field needs a unique one.

## Usage:
```jsx
() => {
  return (
    <div>
      <Rating rating={1} />
      <Rating rating={1.5} />
      <Rating rating={2} />
      <Rating rating={2.5} />
      <Rating rating={3} />
      <Rating rating={3.5} />
      <Rating rating={4} />
      <Rating rating={4.5} />
      <Rating rating={5} />
    </div>
  )
}
```

## Sandbox:
{% embed https://codesandbox.io/embed/dead-simple-react-rating-view-component-cw9ytj?fontsize=14&hidenavigation=1&theme=dark %}
Creating a Single Page Profile Website.
Tags: webdev, beginners, tutorial, css
Published: 2022-06-15 02:15:44

Here's how you can create a free single page profile website which looks professional and simplistic. 

We will be building it using [css profile cards](https://xcattx.com/css-profile-cards/), which are just single page websites with a card design.

## Create the Basic Html Structure

First we'll create two files,index.html and index.css. After creating the files open them using any code editor of your choice.

Now create the basic html format - 

```
<!DOCTYPE html>
<html lang="en">
  <head>
    <meta charset="utf-8">
    <link rel="stylesheet" href="index.css">
    <title></title>
  </head>
  <body>
</body>
</html>
```
Our profile card will contain four things, the profile image, the bio, the name and a button.

So we'll create a new container 'cont' and enter the rest of the things we want inside of it.

```
<div class="cont">
      <img src="https://dev-to-uploads.s3.amazonaws.com/uploads/user/profile_image/877285/37538b37-77d4-46a2-b7e0-6e3125cbb3e8.png" alt="">
      <h1>Your Name</h1>
      <p>Web Designer</p>
      <p>Hello, I'm a web Designer.
Over 2 years of experience.</p>
      <button type="button" name="button">Button Text</button>
    </div>
```
The html is now done, lets now add the Styling.

## Adding Styling to the Profile Card

First enter the basic styling for the whole body.

```
body{
  margin: 0;
  padding: 0;
  background-color: #000000;
}
```
After this we'll style the 'cont' div with simplistic styling.

```
.cont{
  width: 255px;
  background-color: #fff;
  text-align: center;
  padding: 40px;
  margin: auto;
  margin-top: 5%;
  font-family: sans-serif;
  box-shadow: 0px 2px 2px rgba(0, 0, 0, 0.3);
  border-radius: 3px;
  overflow: hidden;
}
```
The profile card is colored white with a black background, cause it looks better.

Now we can style the image, the image will be rounded image.

```
img{
  width: 150px;
  height: 150px;
  border-radius: 50%;
  overflow: hidden;
}
```
After this the h1 and the p tags.

```
h1{
  font-size: 25px;
  color: #292525;
}
p{
  font-size: 18px;
  color: #555;
  overflow: hidden;
  width: 255px;
}
```
Once all the other stylings are done you can style the button and add a hover effect to it.

```
button{
  background: #3598dc;
  border: none;
  width: 50%;
  height: 40px;
  color: #fff;
  border-radius: 3px;
  font-size: 13px;
  outline: none;
}
button:hover{
  background-color:#fff;
  border:2px solid #3598dc;
  color:Black;
  width: 50%;
  font-size: 14px;
}
```

The Profile card website is now ready, you can easily host it on GitHub Pages and share it with your friends.
1/30 days of Java
Tags: beginners, java, challenge, 30daysofcode
Published: 2022-06-15 02:15:00

In my first day of this challenge, I already found something that I did not know!

While I was coding and trying to solve this challenge, I did not know what was wrong, because it simply was not making any sense in my head. My problem was the following: I had to create three variable. One for an integer value, other for a double value and the last one, for a string. I also had inputs for all of the them. The problem was that, the compiler was not reading the last input (`nextLine`) and I discovered that, for some reason, when the compiler starts getting the values, it jumps the `nextLine` command and to solve this, we need to convert it.

I am still researching and learning about this to know why and how it works, but, pretty exciting thus far.

For curiosity, this is how I was doing:
![Java code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/cbrblsfiwmm1f8rx8y73.png)
 

And this is how it works:
![Java code](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/ophml8jsu7t9ejc6qbyf.png)
HOW to Parse JSON Online?
Tags: json, tools, webdev
Published: 2022-06-15 02:10:30

A common use of JSON is to exchange data to/from a web server.

When receiving data from a web server, the data is always a string.

The JSON.parse() method parses a JSON string, constructing the JavaScript value or object described by the string. An optional reviver function can be provided to perform a transformation on the resulting object before it is returned.

Here are few tools can be used to parse JSON online:

- [JSON Parser](https://jsonformatter.org/json-parser)
- [JSON Viewer](https://codebeautify.org/jsonviewer)

![JSON Parser](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gb93rj0jjbcipb4qg4v2.png)
Print Binary Tree
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 02:00:47

Given the `root` of a binary tree, construct a **0-indexed** `m x n` string matrix `res` that represents a **formatted layout** of the tree. The formatted layout matrix should be constructed using the following rules:

*   The **height** of the tree is `height` and the number of rows `m` should be equal to `height + 1`.
*   The number of columns `n` should be equal to `2height+1 - 1`.
*   Place the **root node** in the **middle** of the **top row** (more formally, at location `res[0][(n-1)/2]`).
*   For each node that has been placed in the matrix at position `res[r][c]`, place its **left child** at `res[r+1][c-2height-r-1]` and its **right child** at `res[r+1][c+2height-r-1]`.
*   Continue this process until all the nodes in the tree have been placed.
*   Any empty cells should contain the empty string `""`.

Return _the constructed matrix_ `res`.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/05/03/print1-tree.jpg)

**Input:** root = \[1,2\]
**Output:** 
\[\["","1",""\],
 \["2","",""\]\]

**Example 2:**

![](https://assets.leetcode.com/uploads/2021/05/03/print2-tree.jpg)

**Input:** root = \[1,2,3,null,4\]
**Output:** 
\[\["","","","1","","",""\],
 \["","2","","","","3",""\],
 \["","","4","","","",""\]\]

**Constraints:**

*   The number of nodes in the tree is in the range `[1, 210]`.
*   `-99 <= Node.val <= 99`
*   The depth of the tree will be in the range `[1, 10]`.

**SOLUTION:**

    # Definition for a binary tree node.
    # class TreeNode:
    #     def __init__(self, val=0, left=None, right=None):
    #         self.val = val
    #         self.left = left
    #         self.right = right
    class Solution:
        def getHeight(self, root):
            if root:
                return 1 + max(self.getHeight(root.left), self.getHeight(root.right))
            return 0
        
        def printTree(self, root: Optional[TreeNode]) -> List[List[str]]:
            h = self.getHeight(root)
            cols = (1 << h) - 1
            rows = h
            op = [["" for i in range(cols)] for j in range(rows)]
            nodes = [(root, 0, 0, cols)]
            while len(nodes) > 0:
                curr, l, a, b = nodes.pop()
                if curr:
                    i = (a + b) // 2
                    op[l][i] = str(curr.val)
                    nodes.append((curr.left, l + 1, a, i))
                    nodes.append((curr.right, l + 1, i, b))
            return op
Things to do - Dev Advocate Journal #DAJ 4
Tags: devjournal, productivity, daj
Published: 2022-06-15 01:52:08

This morning I had the opportunity to find an interesting video about Developer Advocate, and I loved the definition they say:

> Developer advocates teaching developers how to use the products

![inlove](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/99fc7cnk0girktesf20f.gif)

I love teaching and helping, and that definition motivates me a lot.

...

Later, throughout the day, no matter how motivated I was, I was a little worried about the absurd number of things I had to do. I think that happens to everyone, and the witcher of Youtube knows this and recommends me a video about breath 😅 


Breathing didn't do my job, but it made me get the ideas out of my head, have more clarity, and focus on what really matters.

Try it and tell me your experience.
製作可攜式版本的 Visual Studio Code
Tags: vscode, portable
Published: 2022-06-15 01:51:57

[下載 Visual Studio Code](https://code.visualstudio.com/download) 的時候會有 **zip** 格式的選項可以選擇, 不過如果你只是單純下載後解開, 它並不是真正的可攜式版本, 不論是設定檔案還是你安裝的延伸套件都還是會放在使用者自己的資料夾中。如果想要製作一個真正[可攜的 vscode](https://code.visualstudio.com/docs/editor/portable), 只要在解開的資料夾中建立一個 [`data` 資料夾](https://code.visualstudio.com/docs/editor/portable#_enable-portable-mode)即可, 這樣所有跟 vscode 相關的檔案都會放在這個 `data` 資料夾下, 像是這樣：

```
VSCODE
├─bin
├─data
│  ├─extensions
│  │  ├─ms-python.vscode-pylance-2022.6.10
│  │  ├─...
│  │  └─ms-vscode.cpptools-themes-1.0.0
│  └─user-data
│      ├─Backups
│      ├─...
│      └─Workspaces
├─locales
├─policies
│  └─en-US
├─resources
│  └─app
├─swiftshader
└─tools
```

這樣只要將整個 vscode 資料夾複製起來, 就可以移到其他機器上使用, 甚至可以在同一台機器上建置不同的 vscode 環境使用。

以上的用法適用於 Windows 與 Linux, 如果是 Mac, 請參照[官方說明文件](https://code.visualstudio.com/docs/editor/portable#_macos)。 

## 執行 bin 資料夾下的 code.cmd

要注意的是, 如果你直接執行 vscode 資料夾下的 `code.exe`, 會噴出一大堆的訊息, 像是這樣：

![](https://i.imgur.com/di7GFND.png)


請改成執行 `bin` 資料夾下的 `code.cmd` 批次檔, 它會幫你加上必要的參數, 就不會噴出你不需要觀看的訊息了。如果要在 `path` 環境變數加入 vscode 的路徑, 也請記得要加入的是 `bin` 資料夾的路徑。

## 升級版本

可攜式 vscode 一樣會在有新版本的時候通知你：

![](https://i.imgur.com/JzErDZB.png)

但是按下連結後並不會自動幫你更新, 而是直接帶你下載新版本的 zip 格式檔案, 你必須自己下載新的版本, 然後解開覆蓋掉舊版本的資料夾。或者你也可以解開新的版本, 將原本的 `data` 資料夾複製過去。

如果是 Mac, 官方文件說明一樣會自動更新。
CodeSkate
Tags: php, productivity
Published: 2022-06-15 01:38:05

After a lot of time and work with PHP, I never felt comfortable with frameworks.
It was the reason I made mine. My little minimalist framework.
I went against the MVC model
**CodeSkate** is based on a model of classes that interact with themes. And the connection to the database is instantiated from the class in the library container.
For each class that is created, its theme must be created and that's it.

**Skater** in the command client which at the moment allows you to create the files from the terminal.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/e5ou162iw7znb92r64ft.JPG)

Example: `php skater -class classname`

I don't know if anyone wants to use it, I don't care about that for now, but I'm going to share my work.

https://github.com/stndc/codeskate
Predict the Winner
Tags: leetcode, dsa, theabbie
Published: 2022-06-15 01:30:37

You are given an integer array `nums`. Two players are playing a game with this array: player 1 and player 2.

Player 1 and player 2 take turns, with player 1 starting first. Both players start the game with a score of `0`. At each turn, the player takes one of the numbers from either end of the array (i.e., `nums[0]` or `nums[nums.length - 1]`) which reduces the size of the array by `1`. The player adds the chosen number to their score. The game ends when there are no more elements in the array.

Return `true` if Player 1 can win the game. If the scores of both players are equal, then player 1 is still the winner, and you should also return `true`. You may assume that both players are playing optimally.

**Example 1:**

**Input:** nums = \[1,5,2\]
**Output:** false
**Explanation:** Initially, player 1 can choose between 1 and 2. 
If he chooses 2 (or 1), then player 2 can choose from 1 (or 2) and 5. If player 2 chooses 5, then player 1 will be left with 1 (or 2). 
So, final score of player 1 is 1 + 2 = 3, and player 2 is 5. 
Hence, player 1 will never be the winner and you need to return false.

**Example 2:**

**Input:** nums = \[1,5,233,7\]
**Output:** true
**Explanation:** Player 1 first chooses 1. Then player 2 has to choose between 5 and 7. No matter which number player 2 choose, player 1 can choose 233.
Finally, player 1 has more score (234) than player 2 (12), so you need to return True representing player1 can win.

**Constraints:**

*   `1 <= nums.length <= 20`
*   `0 <= nums[i] <= 107`

**SOLUTION:**

    class Solution:
        def canWin(self, nums, i, j, ascore, bscore, aturn):
            if i > j:
                if aturn:
                    return ascore >= bscore
                return bscore > ascore
            if aturn:
                return not self.canWin(nums, i + 1, j, ascore + nums[i], bscore, False) or not self.canWin(nums, i, j - 1, ascore + nums[j], bscore, False)
            return not self.canWin(nums, i + 1, j, ascore, bscore + nums[i], True) or not self.canWin(nums, i, j - 1, ascore, bscore + nums[j], True)
        
        def PredictTheWinner(self, nums: List[int]) -> bool:
            n = len(nums)
            return self.canWin(nums, 0, n - 1, 0, 0, True)
c++ - valid parenthesis
Published: 2022-06-15 01:28:27

Still not fully understood but here's the solution

```cpp
class Solution {
public:
    bool isValid(string s) {
        unordered_map<char, char> bracketHash;
        
        bracketHash['{'] = '}';
        bracketHash['['] = ']';
        bracketHash['('] = ')';
        
        stack<char> st;
        
        char last;
        
        int checkVal;
        
        if (s.length() == 0)
        {
            return true;
        }
        
        if (s[0] == '}' || s[0] == ']' || s[0] == ')')
        {
            return false;
        }
        
        for (int i = 0; i < s.size(); ++i)    
        {
            if (s[i] == '{' || s[i] == '(' || s[i] == '[')
            {
                st.push(s[i]);
            }
            
            else
            {
                
                if (st.empty())
                {
                    return false;
                }
                else if (s[i] != bracketHash[st.top()])
                {
                    return false;
                }
                st.pop();
            }
        }
        
        
        return st.empty();
    }
};
```

You might wonder why I post then. I know I solved this in Python. Just adopted the same logic. Still long way to go to think like a computer. I need time to understand. I mean I understand all the methods and why it works but did not run loop myself to simulate long bracket in my head.