teleren/devto huggingface dataset:
Bitwise AND of Numbers Range
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 04:30:36

Given two integers `left` and `right` that represent the range `[left, right]`, return _the bitwise AND of all numbers in this range, inclusive_.

**Example 1:**

**Input:** left = 5, right = 7
**Output:** 4

**Example 2:**

**Input:** left = 0, right = 0
**Output:** 0

**Example 3:**

**Input:** left = 1, right = 2147483647
**Output:** 0

**Constraints:**

*   `0 <= left <= right <= 231 - 1`

**SOLUTION:**

    class Solution:
        def rangeBitwiseAnd(self, left: int, right: int) -> int:
            if left == 0 or right == 0:
                return 0
            a = "{:b}".format(left)
            b = "{:b}".format(right)
            if len(a) != len(b):
                return 0
            res = 1 << len(a) - 1
            return res + self.rangeBitwiseAnd(left - res, right - res)
PowerApps Attachments
Tags: javascript, beginners, programming, powerapps
Published: 2022-06-16 04:29:28

I have a PowerApps which allows the team to attach files. The information entered in the App is linked to Sharepoint. Once I export all the data from Sharepoint, I am unable to see any link to the attachments. Is there a way to export a link for those attachments in excel?
Different Editing Modes in Angular Gantt Chart
Tags: webdev, angular, angularj
Published: 2022-06-16 04:23:41

Learn how to enable editing in the Angular Gantt Chart component of Syncfusion. Also see how to perform cell, dialog, taskbar, and dependency editing in Gantt charts. Gantt component features are segregated into individual feature-wise modules. To use editing feature, inject the Edit module. To use a selection feature, inject the Selection module.

Product overview: https://www.syncfusion.com/angular-ui-components/angular-gantt-chart

Download the example from GitHub: https://github.com/SyncfusionExamples/different-editing-modes-in-angular-gantt-chart

{% youtube JZHpwZXHm7A %}
Airflow 2.3, A new feature that I Like.
Published: 2022-06-16 04:17:19

Airflow 2.3 just came out and here's what I interested about.

### Grid View replaces Tree View
![thenewgridview](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/olytncfmartak9edolmt.png)
I think it's great since it's tell me the list of task with duration on the top of the grid.

I can see if a task take longer time to run than usual without hover on it or open another tab to see the duration of each task.
It's good that we can know [which file is failed](https://youtu.be/4APWCHgfmCo?t=1659) and it's make our task atomic as much as possible.


The Airflow team also mentioned that it's great for checking **mapping task** as well.



**Reference:**
- [Release note](https://airflow.apache.org/blog/airflow-2.3.0/)
Sort Even and Odd Indices Independently
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 04:00:42

You are given a **0-indexed** integer array `nums`. Rearrange the values of `nums` according to the following rules:

1.  Sort the values at **odd indices** of `nums` in **non-increasing** order.
    *   For example, if `nums = [4,**1**,2,**3**]` before this step, it becomes `[4,**3**,2,**1**]` after. The values at odd indices `1` and `3` are sorted in non-increasing order.
2.  Sort the values at **even indices** of `nums` in **non-decreasing** order.
    *   For example, if `nums = [**4**,1,**2**,3]` before this step, it becomes `[**2**,1,**4**,3]` after. The values at even indices `0` and `2` are sorted in non-decreasing order.

Return _the array formed after rearranging the values of_ `nums`.

**Example 1:**

**Input:** nums = \[4,1,2,3\]
**Output:** \[2,3,4,1\]
**Explanation:** 
First, we sort the values present at odd indices (1 and 3) in non-increasing order.
So, nums changes from \[4,**1**,2,**3**\] to \[4,**3**,2,**1**\].
Next, we sort the values present at even indices (0 and 2) in non-decreasing order.
So, nums changes from \[**4**,1,**2**,3\] to \[**2**,3,**4**,1\].
Thus, the array formed after rearranging the values is \[2,3,4,1\].

**Example 2:**

**Input:** nums = \[2,1\]
**Output:** \[2,1\]
**Explanation:** 
Since there is exactly one odd index and one even index, no rearrangement of values takes place.
The resultant array formed is \[2,1\], which is the same as the initial array. 

**Constraints:**

*   `1 <= nums.length <= 100`
*   `1 <= nums[i] <= 100`

**SOLUTION:**

    import heapq
    
    class Solution:
        def sortEvenOdd(self, nums: List[int]) -> List[int]:
            n = len(nums)
            evens = []
            odds = []
            for i in range(n):
                if i & 1:
                    heapq.heappush(odds, -nums[i])
                else:
                    heapq.heappush(evens, nums[i])
            for i in range(n):
                if i & 1:
                    nums[i] = -heapq.heappop(odds)
                else:
                    nums[i] = heapq.heappop(evens)
            return nums
Goals of my blog.
Published: 2022-06-16 03:47:08

This post is for anyone who wants understand my motives here and this will serve as guideline for me to follow moving forward.

# Overview
Often throughout my professional careers, I found myself being the best version of myself when I could not only fully understand and perform tasks, but also if I could teach them and had everything documented for easy reference.

## Teaching
I'll be giving small micro lessons in everything I know (regardless of the fact that this probably exists everywhere). Why would I repeat content folks have written about practically everywhere? Everyone learns concepts in totally different ways. My perspective I'm going to be offering might be the way someone needs to understand a concept or operation.

## Documenting
Also, this will serve as my own personal reference for everything I know. I have come to realize that my documentation and records of research are lacking for my work, therefore this should help improve my notes for everything I have done.
Best Code to check if number is Prime
Tags: computerscience, codenewbie, programming
Published: 2022-06-16 03:44:52

C Program
![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/2fa5f5v8oye793m6ir4e.png)
 
 
You can try the code using the following link:
[Code](https://onlinegdb.com/BOQ5GL06Z)
Lowest Common Ancestor of Deepest Leaves
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 03:30:34

Given the `root` of a binary tree, return _the lowest common ancestor of its deepest leaves_.

Recall that:

*   The node of a binary tree is a leaf if and only if it has no children
*   The depth of the root of the tree is `0`. if the depth of a node is `d`, the depth of each of its children is `d + 1`.
*   The lowest common ancestor of a set `S` of nodes, is the node `A` with the largest depth such that every node in `S` is in the subtree with root `A`.

**Example 1:**

![](https://s3-lc-upload.s3.amazonaws.com/uploads/2018/07/01/sketch1.png)

**Input:** root = \[3,5,1,6,2,0,8,null,null,7,4\]
**Output:** \[2,7,4\]
**Explanation:** We return the node with value 2, colored in yellow in the diagram.
The nodes coloured in blue are the deepest leaf-nodes of the tree.
Note that nodes 6, 0, and 8 are also leaf nodes, but the depth of them is 2, but the depth of nodes 7 and 4 is 3.

**Example 2:**

**Input:** root = \[1\]
**Output:** \[1\]
**Explanation:** The root is the deepest node in the tree, and it's the lca of itself.

**Example 3:**

**Input:** root = \[0,1,3,null,2\]
**Output:** \[2\]
**Explanation:** The deepest leaf node in the tree is 2, the lca of one node is itself.

**Constraints:**

*   The number of nodes in the tree will be in the range `[1, 1000]`.
*   `0 <= Node.val <= 1000`
*   The values of the nodes in the tree are **unique**.

**Note:** This question is the same as 865: [https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/](https://leetcode.com/problems/smallest-subtree-with-all-the-deepest-nodes/)

**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 maxDepth(self, root):
            if root:
                a = 1 + self.maxDepth(root.left)
                b = 1 + self.maxDepth(root.right)
                return max(a, b)
            return -1
        
        def lcaDeepestLeaves(self, root: Optional[TreeNode]) -> Optional[TreeNode]:
            if root:
                left = self.maxDepth(root.left)
                right = self.maxDepth(root.right)
                if left > right:
                    return self.lcaDeepestLeaves(root.left)
                elif right > left:
                    return self.lcaDeepestLeaves(root.right)
                else:
                    return root
Sweater By BAPE
Published: 2022-06-16 03:15:16

Want some style inspiration? Check this out. Sweatshirts add variety and make you stand out. Besides being trendy, Bape sweatshirts are also warm. Visiting or living in a cold place will require you to wear many wearables. An ape sweater looks great with sweatpants and a bape sweatshirt.
Bape sweaters: what's your take? Do you love them too? In addition to being super comfy, their style is cool too. There's nothing like a Bape sweatshirt to keep you warm this winter, especially if you're in need; check out our collection to find your next favorite. Clothing item. Bape **[a Bathing Ape](https://bapehoodie.co/)** sweatshirts look good no matter what you're wearing. Fashionably speaking, bape sweaters are extremely popular. They've been worn by rappers and celebrities for years. The official Bape Hoodie website sells Bape products.

![Image description](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/iqyuizeouzm0k7ryi5r4.jpg)
Flutter at Google I/O
Tags: flutter, google, beginners, googleio
Published: 2022-06-16 03:14:43

---
title: Flutter at Google I/O
published: true
description: How Flutter evolve over time
tags: flutter, google, beginners, googleIO
cover_image: https://www.showmetech.com.br/wp-content/uploads//2022/05/Google-IO-2022-1920x1024.jpg
---
Google I/O is one of the **most significant** tech events in the world. For people, the press, and tech artists/enthusiasts.

**Flutter 3** was introduced at Google I/O 2022.

But his debut at this event was in 2017.

Here is a quick recap on how Flutter evolved and how the **headlines** changed over time.

---

**2017: Single codebase, two apps** 

[A simple app built with Flutter + Firebase](https://youtu.be/w2TcYP8qiRI)

*"learn how to build beautiful cross-platform UIs with Flutter"*

---

**2018: Production ready**
[BLoC state management at stage](https://youtu.be/RS36gBEp8OI)

*"practical demonstration and live coding, learn patterns for crafting elegant and intuitive code"*

---

**2019: A portable UI framework**

[Shout-out for provider](https://youtu.be/d_m5csmrf7I)

*"understanding the main approaches of state management in declarative frameworks"*

---

**2020:** no event

---

**2021: Leading UI toolkit for multiplatform**

[Top 7 Flutter things](https://youtu.be/S5aK3TIOnIw)

*"practical demonstration and live coding, learn patterns for crafting elegant and intuitive code"*

---

**2022: From a mobile-centric to a multiplatform**

[6 minute recap](https://youtu.be/OOHr8cn2Z0g)

*"practical demonstration and live coding, learn patterns for crafting elegant and intuitive code"*

---

**Conclusion**

Wow... what a journey from two apps to multiplatform.

Hard (and smart) work for the Flutter team and **community**.

A single codebase targetting six platforms.

What's next 🤔 

Drop a comment  

---

Thank you,
[rubensdemelo](https://twitter.com/rubensdemelo)
Ugly Number
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 03:00:46

An **ugly number** is a positive integer whose prime factors are limited to `2`, `3`, and `5`.

Given an integer `n`, return `true` _if_ `n` _is an **ugly number**_.

**Example 1:**

**Input:** n = 6
**Output:** true
**Explanation:** 6 = 2 × 3

**Example 2:**

**Input:** n = 1
**Output:** true
**Explanation:** 1 has no prime factors, therefore all of its prime factors are limited to 2, 3, and 5.

**Example 3:**

**Input:** n = 14
**Output:** false
**Explanation:** 14 is not ugly since it includes the prime factor 7.

**Constraints:**

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

**SOLUTION:**

    class Solution:
        def isUgly(self, n: int) -> bool:
            if n == 0:
                return False
            while n % 2 == 0:
                n = n // 2
            while n % 3 == 0:
                n = n // 3
            while n % 5 == 0:
                n = n // 5
            return n == 1
Building our first project: A prototype using React js and Material UI
Tags: react, javascript, webdev, career
Published: 2022-06-16 02:57:23



On this week we’re going to focus on building the first prototype of our project, i’ts going to be about building de Web views with React js and Material UI. If we already think of a design or have one in Figma it’s time to start working on it. 

## What is React js?

React is an open source UI library  based on Javascript, it’s declarative and component based. This allows us to work faster and design views for each states in our application, components allows us to recycle and use them on other views that are needed. Also it works with JSX which is a file that allow us to write HTML and javascript at the same time.

## How Material UI Works?

Material UI based on Material Design is a CSS framework that allows us to build our own Design System. It has a lot of prebuilt components ready to use and customize in our application. This helps us to improve the UI/UX on our project and is easy to use

## What’s next?

Once we already know what technologies we want to use, we need to start working on our project, it is important to know that in this week we’re not going to finish it all. But start coding our views would be a great advantage.

On the next week we’re going to focus on functionality and security of the project. If you missed out my last post you can find it here: https://dev.to/anamdiazs/learning-to-build-a-project-from-scratch-in-4-weeks-implementing-agile-methodologies-5b4g
Integrate dofeedbackin into your web project
Tags: webdev, beginners, tutorial, react
Published: 2022-06-16 02:36:40


Let's start by integrating the dofeedbackin platform into your web application.
Follow the previous article on Signup for dofeedbackin.
https://dev.to/lmas3009/signup-for-dofeedbackin-4ado

You can test your api here: 👇
https://dofeedbackin.netlify.app/testing.html

![home](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/86dqgtn1bpnlzlj7xkac.png)
 

> Let's started

Creating a simple web app which a simple form that accepts username, email id, Phone number (optional), feedback1, feedback2 (optional), and feedback3 (optional).
![table](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w91fdhuxmiyyj9u709qd.png)
 
Let's create a simple form in web app which accepts username, emailid, and feedback. We can call it as feedback form.

Create a simple html page with form.
https://gist.github.com/lmas3009/16cfb426b5016378d007fd748ffad99e

Now under html page add your api key in script src tag

Now you can test your web app and see the result in dofeedbackin platform.

If you have any queries/doudths/suggestions. Comment it down.

Thanks for Reading the article.. 💗

If you tried this application and built a simple app, please post in twitter with #dofeedbackin hashtag and tag me AravindKumarV09.
Signup for dofeedbackin
Tags: webdev, programming, tutorial, react
Published: 2022-06-16 02:31:01


Let's start creating an account with dofeedbackin.
![logo](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/wxufd68sqdbrer39ovcq.png)
 
Steps to follow:

1. Open the [dofeedbackin](http://dofeedbackin.netlify.app/) website
2. Click on Get started
![landing](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/r0s6gu9qd6cvsx3p7s3e.png)
 

3. You will see a signup page if you already have an account click on sign in else create a new account.
![create](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/avj2bn9yhmowiznj1ldn.png)
 ![signin](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/gkrhfv3j1zxevsvt0qxv.png)
 
4. You will see a home page and you will see your profile info, you can update your full name, and view your username and email id.
![home](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/0xp5qt1t2qjgvhftt95g.png)
 
5. Click on Add new project to create a new project.
6. Now enter your project name, project description, and API Key (optional to enter or click auto-generate).
![project](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/49240gf08cq3c41kssbq.png)
 
Note: The below tables are default tables that you need to add to your forms

Now click on Submit to create a new project.

Now you will see the homepage like this:
![home1](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/29xrbp0skgmtd4ybtluj.png)
 
7.Now click the open button on the project card and you will see the project page.
![pp](https://dev-to-uploads.s3.amazonaws.com/uploads/articles/w95rf64ahxpgz8ygk5ri.png)
 
8.Now click on the Copy URL to copy the path, which you need for your project.

Yayy. You just signed up and created a new project in dofeedbackin.

Thanks for reading the article….
Maximize Number of Subsequences in a String
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 02:30:40

You are given a **0-indexed** string `text` and another **0-indexed** string `pattern` of length `2`, both of which consist of only lowercase English letters.

You can add **either** `pattern[0]` **or** `pattern[1]` anywhere in `text` **exactly once**. Note that the character can be added even at the beginning or at the end of `text`.

Return _the **maximum** number of times_ `pattern` _can occur as a **subsequence** of the modified_ `text`.

A **subsequence** is a string that can be derived from another string by deleting some or no characters without changing the order of the remaining characters.

**Example 1:**

**Input:** text = "abdcdbc", pattern = "ac"
**Output:** 4
**Explanation:**
If we add pattern\[0\] = 'a' in between text\[1\] and text\[2\], we get "ab**a**dcdbc". Now, the number of times "ac" occurs as a subsequence is 4.
Some other strings which have 4 subsequences "ac" after adding a character to text are "**a**abdcdbc" and "abd**a**cdbc".
However, strings such as "abdc**a**dbc", "abd**c**cdbc", and "abdcdbc**c**", although obtainable, have only 3 subsequences "ac" and are thus suboptimal.
It can be shown that it is not possible to get more than 4 subsequences "ac" by adding only one character.

**Example 2:**

**Input:** text = "aabb", pattern = "ab"
**Output:** 6
**Explanation:**
Some of the strings which can be obtained from text and have 6 subsequences "ab" are "**a**aabb", "aa**a**bb", and "aab**b**b".

**Constraints:**

*   `1 <= text.length <= 105`
*   `pattern.length == 2`
*   `text` and `pattern` consist only of lowercase English letters.

**SOLUTION:**

    class Solution:
        def countSub(self, a, b):
            m = len(a)
            n = len(b)
            dp = [[0 for i in range(n + 1)] for j in range(m + 1)]
            for i in range(n + 1):
                dp[0][i] = 0
            for i in range(m + 1):
                dp[i][0] = 1
            for i in range(1, m + 1):
                for j in range(1, n + 1):
                    if a[i - 1] == b[j - 1]:
                        dp[i][j] = dp[i - 1][j - 1] + dp[i - 1][j]
                    else:
                        dp[i][j] = dp[i - 1][j]
            return dp[m][n]
        
        def maximumSubsequenceCount(self, text: str, pattern: str) -> int:
            n = len(text)
            mxsub = self.countSub(text, pattern)
            a = text.count(pattern[0])
            b = text.count(pattern[1])
            return mxsub + max(a, b)
            # pos = []
            # for i in range(n):
            #     if text[i] in pattern:
            #         pos.append(i)
            #         pos.append(i + 1)
            # for i in pos:
            #     for j in range(2):
            #         val = self.countSub(text[:i] + pattern[j] + text[i:], pattern)
            #         mxsub = max(mxsub, val)
            # return mxsub
JavaScript DSA for Non-CS Background
Tags: webdev, javascript, programming, beginners
Published: 2022-06-16 02:17:03

Agenda for this article.

1.How much DSA needed for master Javascript for those who are 
recently started coading in JS language and start their career path as Full Stack Developer Journey.

2.How many problems solve to confident and master your Javascript Language Syntax and become JS coader.

3.What are the DSA topics for Javascript mostly used in Full Stack OR Front End job role.
Unique Binary Search Trees II
Tags: leetcode, dsa, theabbie
Published: 2022-06-16 02:00:40

Given an integer `n`, return _all the structurally unique **BST'**s (binary search trees), which has exactly_ `n` _nodes of unique values from_ `1` _to_ `n`. Return the answer in **any order**.

**Example 1:**

![](https://assets.leetcode.com/uploads/2021/01/18/uniquebstn3.jpg)

**Input:** n = 3
**Output:** \[\[1,null,2,null,3\],\[1,null,3,2\],\[2,1,3\],\[3,1,null,null,2\],\[3,2,null,1\]\]

**Example 2:**

**Input:** n = 1
**Output:** \[\[1\]\]

**Constraints:**

*   `1 <= n <= 8`

**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 getTrees(self, beg, end):
            trees = []
            
            if beg > end:
                trees.append(None)
                return trees
    
            for i in range(beg, end + 1):
                left_subtrees = self.getTrees(beg, i - 1)
                right_subtrees = self.getTrees(i + 1, end)
    
                for l in left_subtrees:
                    for r in right_subtrees:
                        tree = TreeNode(val = i, left = l, right = r)
                        trees.append(tree)
            return trees
        
        def generateTrees(self, n: int) -> List[Optional[TreeNode]]:
            return self.getTrees(1, n)