Pages

May 31, 2020

#LeetCode: Edit Distance

Given two words word1 and word2, find the minimum number of operations required to convert word1 to word2.

You have the following 3 operations permitted on a word:
  • Insert a character
  • Delete a character
  • Replace a character

May 30, 2020

Vindu Dara Singh urges fans to tune in to Star Plus to watch his late father

Vindu Dara Singh shares Hanuman’s entry promo from Ramayan as he remembers his father Dara Singh.

Ramayan – the historical mythological show that reached the audiences through television in the yesteryears has made a come-back to re-entertain its audiences on Star Plus, India’s leading Hindi GEC’s.

#LeetCode: K Closest Points to Origin

We have a list of points on the plane.  Find the K closest points to the origin (0, 0).(Here, the distance between two points on a plane is the Euclidean distance.)

You may return the answer in any order.  The answer is guaranteed to be unique (except for the order that it is in.)

May 29, 2020

Taniya Chatterjee roped in for Ullu App's 'Kasak'

Ullu App is coming up with a web-series 'Kasak', which is based on a life of a rape victim. After roping in Hate Story' actress Ihana Dhillon, Minissha Lamba, Vineet Raina the makers have now finalized Gandii Baat 4 fame Taniya Chatterjee.

#LeetCode: Course Schedule

There are a total of numCourses courses you have to take, labeled from 0 to numCourses-1.

Some courses may have prerequisites, for example to take course 0 you have to first take course 1, which is expressed as a pair: [0,1]

Given the total number of courses and a list of prerequisite pairs, is it possible for you to finish all courses?

Example 1:
Input: numCourses = 2, prerequisites = [[1,0]]
Output: true
Explanation: There are a total of 2 courses to take.
             To take course 1 you should have finished course 0. So it is possible.

Example 2:
Input: numCourses = 2, prerequisites = [[1,0],[0,1]]
Output: false
Explanation: There are a total of 2 courses to take.
             To take course 1 you should have finished course 0, and to take course 0 you should
             also have finished course 1. So it is impossible.

Constraints:
The input prerequisites is a graph represented by a list of edges, not adjacency matrices. Read more about how a graph is represented.
You may assume that there are no duplicate edges in the input prerequisites.
1 <= numCourses <= 10^5

GIT URL: Java Solution of Leet Code's Course Schedule problem
Java Solution 1



-K Himaanshu Shuklaa.

May 28, 2020

#LeetCode: Counting Bits

Given a non negative integer number num. For every numbers i in the range 0 ≤ i ≤ num calculate the number of 1's in their binary representation and return them as an array.

Example 1:
Input: 2
Output: [0,1,1]

Example 2:
Input: 5
Output: [0,1,1,2,1,2]

May 27, 2020

#LeetCode: Possible Bipartition

Given a set of N people (numbered 1, 2, ..., N), we would like to split everyone into two groups of any size.

Each person may dislike some other people, and they should not go into the same group.

Formally, if dislikes[i] = [a, b], it means it is not allowed to put the people numbered a and b into the same group.

Return true if and only if it is possible to split everyone into two groups in this way.

May 26, 2020

#LeetCode: Contiguous Array

Given a binary array, find the maximum length of a contiguous subarray with equal number of 0 and 1.

Example 1: Input: [0,1], Output: 2
Explanation: [0, 1] is the longest contiguous subarray with equal number of 0 and 1.

Example 2: Input: [0,1,0], Output: 2
Explanation: [0, 1] (or [1, 0]) is a longest contiguous subarray with equal number of 0 and 1.

Note: The length of the given binary array will not exceed 50,000.

Crime Patrol actress Preksha Mehta commits suicide

Preksha Mehta, who did a couple of episodic's of Crime Patrol committed suicide.


May 25, 2020

#LeetCode: Uncrossed Lines

We write the integers of A and B (in the order they are given) on two separate horizontal lines.

Now, we may draw connecting lines: a straight line connecting two numbers A[i] and B[j] such that:
A[i] == B[j];
The line we draw does not intersect any other connecting (non-horizontal) line.
Note that a connecting lines cannot intersect even at the endpoints: each number can only belong to one connecting line.

Return the maximum number of connecting lines we can draw in this way.

May 24, 2020

#LeetCode: Construct Binary Search Tree from Preorder Traversal

Return the root node of a binary search tree that matches the given preorder traversal.

(Recall that a binary search tree is a binary tree where for every node, any descendant of node.left has a value < node.val, and any descendant of node.right has a value > node.val.  Also recall that a preorder traversal displays the value of the node first, then traverses node.left, then traverses node.right.)

It's guaranteed that for the given test cases there is always possible to find a binary search tree with the given requirements.

May 23, 2020

#LeetCode: Interval List Intersections

Given two lists of closed intervals, each list of intervals is pairwise disjoint and in sorted order.

Return the intersection of these two interval lists.

(Formally, a closed interval [a, b] (with a <= b) denotes the set of real numbers x with a <= x <= b.  The intersection of two closed intervals is a set of real numbers that is either empty, or can be represented as a closed interval.  For example, the intersection of [1, 3] and [2, 4] is [2, 3].)

May 22, 2020

After Gulabo Sitabo & Shakuntala Devi, 'Indoo Ki Jawaani' to be released online?

After Amitabh Bachchan and Ayushmann Khurrana starrer 'Gulabo Sitabo' and Vidya Balan's much awaited 'Shakuntala Devi', Kiara Advani's next 'Indoo Ki Jawaani' might be released online.

As per the latest buzz, "'Indoo Ki Jawaani' is ready and the post-production work will be completed soon. It was suppose to release worldwide on June 5th, 2020, however, due to pandemic release has been postponed. Now, Nikkhil Advani and Monisha Advani, from Emmay Entertainment want to release it on the web. They are already in talks with several OTT platforms, however nothing is finalized as of now."

#LeetCode: Sort Characters By Frequency

Given a string, sort it in decreasing order based on the frequency of characters.

Example 1:
Input: "tree"
Output: "eert"
Explanation:
'e' appears twice while 'r' and 't' both appear once.
So 'e' must appear before both 'r' and 't'. Therefore "eetr" is also a valid answer.

May 21, 2020

#LeetCode: Count Square Submatrices with All Ones

Given a m * n matrix of ones and zeros, return how many square submatrices have all ones.

Example 1:
Input: matrix =
[
  [0,1,1,1],
  [1,1,1,1],
  [0,1,1,1]
]
Output: 15
Explanation:
There are 10 squares of side 1.
There are 4 squares of side 2.
There is  1 square of side 3.
Total number of squares = 10 + 4 + 1 = 15.

May 20, 2020

Anushka Sharma immensely misses celebrity hair maestro Aalim Hakim!

Hands down, Aalim Hakim is definitely the captain when it comes to styling the who's who of Bollywood and known personalities across India including cricketer Virat Kohli.

#LeetCode: Kth Smallest Element in a BST

Given a binary search tree, write a function kthSmallest to find the kth smallest element in it.

Note:
You may assume k is always valid, 1 ≤ k ≤ BST's total elements.

Example 1:
Input: root = [3,1,4,null,2], k = 1
   3
  / \
 1   4
  \
   2
Output: 1
Example 2:
Input: root = [5,3,6,2,4,null,null,1], k = 3
       5
      / \
     3   6
    / \
   2   4
  /
 1
Output: 3

May 19, 2020

#LeetCode: Online Stock Span

Write a class StockSpanner which collects daily price quotes for some stock, and returns the span of that stock's price for the current day.

The span of the stock's price today is defined as the maximum number of consecutive days (starting from today and going backwards) for which the price of the stock was less than or equal to today's price.

For example, if the price of a stock over the next 7 days were [100, 80, 60, 70, 60, 75, 85], then the stock spans would be [1, 1, 1, 2, 1, 4, 6].

May 18, 2020

Tarun Khanna to play a male chauvinist in Ullu App’s next..

Tarun Khanna, who had donned the character of Lord Shiva 8 times will be seen in a different avatar altogether in Ullu App’s upcoming web-series ‘Ishq Kills’.

Usha Bachani to foray into digital world!

Kundali Bhagya actress Usha Bachani is all set to make her debut on the digital platform with Ullu App’s upcoming web-series Ishq Kills. We heard the actress will be playing the role of a docile thakurain in the series.

#LeetCode: Permutation in String

Given two strings s1 and s2, write a function to return true if s2 contains the permutation of s1. In other words, one of the first string's permutations is the substring of the second string.

Example 1:
Input: s1 = "ab" s2 = "eidbaooo"
Output: True
Explanation: s2 contains one permutation of s1 ("ba").

Example 2:
Input:s1= "ab" s2 = "eidboaoo"
Output: False

May 17, 2020

Star Bharat brings forth life lessons from the epic tale of ‘Mahabharat’ for its viewers


Yada yada hi dharmasya glanirbhavati bharata
Abhythanamadharmasya tadatmanam srijamyaham
Paritranaya sadhunang vinashay cha dushkritam
Dharmasangsthapanarthay sambhabami yuge yuge
This verse was described & recited centuries ago by Lord Shri Krishna in Mahabharat when Arjuna had refused to fight in the battle of Kurukshetra, but it still holds / has relevance even in today’s world. During such unprecedented times in the 21st century, it will require the best of humanity to overcome their battle against the deadly pandemic COVID - 19 and keeping in mind this thought Hindi GEC Star Bharat will soon be bringing this legendary epic tale for its viewers with the telecast of BR Chopra’s Mahabharat from 18th May,2020 onwards every day at 8pm. During such a phase, the channel wants more and more viewers to stay at home and witness the concept of Dharma and Karma entwined in a symbiotic relationship in the epic series Mahabharat.

#LeetCode: Find All Anagrams in a String

Given a string s and a non-empty string p, find all the start indices of p's anagrams in s.

Strings consists of lowercase English letters only and the length of both strings s and p will not be larger than 20,100.

The order of output does not matter.

May 16, 2020

#LeetCode: Odd Even Linked List

Given a singly linked list, group all odd nodes together followed by the even nodes. Please note here we are talking about the node number and not the value in the nodes.

You should try to do it in place. The program should run in O(1) space complexity and O(nodes) time complexity.

'Aadat Se Majboor' actor Manmeet Grewal commits suicide

Manmeet Grewal, who was a part of SAB TV's Aadat Se Majboor , Chidiya Ghar and &TV’s ‘Kuldeepak' is no more. We heard he committed suicide by hanging himself in his house on Friday (May 15, 2020) night.

May 15, 2020

#RIP: Kahaani Ghar Ghar Kii actor Sachin Kumar passed away

Actor-turned-photographer Sachin Kumar Arora, who was part of Ekta Kapoor’s show Kahaani Ghar Ghar Kii and Benaifer Kohli's Lajja, has passed away.

#LeetCode: Maximum Sum Circular Subarray

Given a circular array C of integers represented by A, find the maximum possible sum of a non-empty subarray of C.

Here, a circular array means the end of the array connects to the beginning of the array.  (Formally, C[i] = A[i] when 0 < = i  < A.length, and C[i+A.length] = C[i] when i > = 0.)

Also, a subarray may only include each element of the fixed buffer A at most once.  (Formally, for a subarray C[i], C[i+1], ..., C[j], there does not exist i < = k1, k2 < = j with k1 % A.length = k2 % A.length.)

Example 1:
Input: [1,-2,3,-2]
Output: 3
Explanation: Subarray [3] has maximum sum 3

Vidya Balan’s Shakuntala Devi Biopic to premiere on Amazon Prime Video

After Amitabh Bachchan and Ayushmann Khurrana starrer 'Gulabo Sitabo', now 'Shakuntala Devi', featuring Vidya Balan in the titular role, will premiere on Amazon Prime Video.

The film is a biopic on late mathematical wizard Shakuntala Devi, who was nicknamed the human computer for her innate ability to make complex calculations within seconds.

May 14, 2020

#LeetCode: Implement Trie (Prefix Tree)

Implement a trie with insert, search, and startsWith methods.

Example:
Trie trie = new Trie();
trie.insert("apple");
trie.search("apple");   // returns true
trie.search("app");     // returns false
trie.startsWith("app"); // returns true
trie.insert("app"); 
trie.search("app");     // returns true

Note:
You may assume that all inputs are consist of lowercase letters a-z.
All inputs are guaranteed to be non-empty strings.

Amitabh Bachchan and Ayushmann Khurrana's ‘Gulabo Sitabo’ to premiere on Amazon Prime Video

Amazon Prime Video today announced the global premiere of the highly anticipated Hindi film Gulabo Sitabo exclusively on the streaming service. Directed by Shoojit Sircar, the film stars Amitabh Bachchan (Black, Piku) and Ayushmann Khurrana (Shubh Mangal Zyaada Saavdhan, Andhadhun) in the lead. The movie will premiere exclusively on the 12th of June, 2020 on Amazon Prime Video and will be available in 200 countries and territories worldwide.

I am all for new tunes: Asha Bhosle

She has been bestowed with contagious energy, an ever-youthful persona and voice that has mesmerised audiences transcending generations. Now, Asha Bhosle is on YouTube with her channel 'Asha Bhosle Official' youthful original content, albeit with a dash of spiritualism!

May 13, 2020

рд░ाрдо рдЬी рдХी рдЪिрдб़िрдпा рд░ाрдо рдЬी рдХा рдЦेрдд!

рдЖрдЬ рджोрдкрд╣рд░ рдоें рдЦाрдиा рдмрдиाрддे рд╡реШ्рдд рдЪाрд╡рд▓ рдоें рдХुрдЫ рдХीреЬे рджिрдЦे, рдоैंрдиे рд╕ोрдЪा рдЪाрд╡рд▓ рдлेрдХрдиे рд╕े рдмेрд╣рддрд░ рд╣ै рдЗрди्рд╣े рдзुрдк рдоें рд░рдЦ рджू। рд╢्рдпाрдо рдХो рдЬрдм рдоैं рдЪाрд╡рд▓ рдХी рдк्рд▓ेрдЯ рдЦिреЬрдХी рд╕े рдЙрдаाрдиे рдЧрдпा рддो рджेрдЦा, рек-рел рдЪिреЬिрдпा рдФрд░ рдХुрдЫ рдХрдмूрддрд░ рдмреЬे рдЖрд░ाрдо рд╕े рдЪाрд╡рд▓ рдЦा рд░рд╣े рд╣ै। рдоुрдЭे рдЧुрд╕्рд╕ा рдЖ рдЧрдпा рдФрд░ рдоैंрдиे реЫोрд░ рд╕े рдЪिрд▓्рд▓ाрдпा, рдмिрдЪाрд░े рдЪिреЬिрдпा рдФрд░ рдХрдмूрддрд░ рдбрд░ рдХे рдЙреЬ рдЧрдП। рдЬ्рдпाрджा рдиुрдХ्рд╕ाрди рдирд╣ीं рд╣ुрдЖ рдпे рд╕ोрдЪрдХे рдоैं реЩुрд╢ рд╣ो рд╣ी рд░рд╣ा рдеा рдХे рдЧुрд░ु рдиाрдирдХ рджेрд╡ рдЬी рдХी рдПрдХ рдмाрдд рдпाрдж рдЖ рдЧрдпी।

рд▓ॉрдХрдбाрдЙрди рдХे рддрдХрд░ीрдмрди реи рд╣рдл्рддे рдкрд╣рд▓े рд╡рд░्рд╕ोрд╡ा рдХे рдЧुрд░ुрдж्рд╡ाрд░ा рд╕ाрд╣िрдм рд╕рдЪрдЦंрдб рджрд░рдмाрд░ рдЬाрдиा рд╣ुрдЖ рдеा, рд╡рд╣ाँ рдЧुрд░ु рдиाрдирдХ рджेрд╡ рдЬी рд╕े рдЬुрдб़ी рдХी рдЦूрдмрд╕ूрд░рдд рдмाрдд рд╕ुрдирдиे рдХो рдоिрд▓ी। рдиाрдирдХ рдХे рдкिрддा рдХा рдиाрдо рдХрд▓्рдпाрдирдЪंрдж рджाрд╕ рдмेрджी рдеा, рдЬो рдкेрд╢े рд╕े рдкрдЯрд╡ाрд░ी рд╣ुрдЖ рдХрд░рддे рдеे।

#LeetCode: Remove K Digits

Given a non-negative integer number represented as a string, remove k digits from the number so that the new number is the smallest possible.

May 12, 2020

#LeetCode:Single Element in a Sorted Array

You are given a sorted array consisting of only integers where every element appears exactly twice, except for one element which appears exactly once. Find this single element that appears only once.

Example 1:
Input: [1,1,2,3,3,4,4,8,8]
Output: 2

Example 2:
Input: [3,3,7,7,10,11,11]
Output: 10

May 11, 2020

#LeetCode: Flood Fill

An image is represented by a 2-D array of integers, each integer representing the pixel value of the image (from 0 to 65535).

Given a coordinate (sr, sc) representing the starting pixel (row and column) of the flood fill, and a pixel value newColor, "flood fill" the image.

To perform a "flood fill", consider the starting pixel, plus any pixels connected 4-directionally to the starting pixel of the same color as the starting pixel, plus any pixels connected 4-directionally to those pixels (also with the same color as the starting pixel), and so on. Replace the color of all of the aforementioned pixels with the newColor.

#LeetCode: Squares of a Sorted Array

Given an array of integers A sorted in non-decreasing order, return an array of the squares of each number, also in sorted non-decreasing order.

Example 1:
Input: [-4,-1,0,3,10]
Output: [0,1,9,16,100]

#RIP: Actor Shafique Ansari passes away

Actor Shafique Ansari, well known for his cameo appearances in Crime Patrol passed away on Sunday, May 10, 2020. We heard, the actor had been battling cancer for a few years.

May 10, 2020

#AuntyKahoNa: On Mother’s Day Twinkle Khanna wants her kids to call her AUNTY

The actor-turned-author Twinkle Khanna shared a monologue on her Instagram page on the occasion of Mother’s Day.

In the hilarious video, which is full of MrsFunnyBones's signature sarcasm reevealed what all the mothers really want from their children instead of all the fancy greetings.

The 46-year-old author, said, what she really wants for Mother's day is a day off from responsibilities, to not be asked where is the blue t-shirt, if her kids can go to visit their friends and when the coronavirus lockdown is going to end.

The monologue, shared by Twinkle also features how she wants her kids to call her 'aunty' on mother's day and not 'mummy'.

#LeetCode:Find the Town Judge

In a town, there are N people labelled from 1 to N.  There is a rumor that one of these people is secretly the town judge.

If the town judge exists, then:
The town judge trusts nobody.
Everybody (except for the town judge) trusts the town judge.
There is exactly one person that satisfies properties 1 and 2.
You are given trust, an array of pairs trust[i] = [a, b] representing that the person labelled a trusts the person labelled b.

May 09, 2020

#LeetCode: Valid Perfect Square

Given a positive integer num, write a function which returns True if num is a perfect square else False.

Note: Do not use any built-in library function such as sqrt.

Example 1:
Input: 16
Output: true

Example 2:
Input: 14
Output: false

May 08, 2020

#LeetCode:Check If It Is a Straight Line

You are given an array coordinates, coordinates[i] = [x, y], where [x, y] represents the coordinate of a point. Check if these points make a straight line in the XY plane.

Constraints:
  • 2  < = coordinates.length <= 1000
  • coordinates[i].length == 2
  • -10 ^ 4  < = coordinates[i][0], coordinates[i][1] < = 10^4
  • coordinates contains no duplicate point.

May 07, 2020

#LeetCode:Cousins in Binary Tree

In a binary tree, the root node is at depth 0, and children of each depth k node are at depth k+1.

Two nodes of a binary tree are cousins if they have the same depth, but have different parents.

We are given the root of a binary tree with unique values, and the values x and y of two different nodes in the tree.

Return true if and only if the nodes corresponding to the values x and y are cousins.

#LeetCode: Find Numbers with Even Number of Digits

Given an array nums of integers, return how many of them contain an even number of digits.

Example 1:
Input: nums = [12,345,2,6,7896]
Output: 2
Explanation:
  • 12 contains 2 digits (even number of digits). 
  • 345 contains 3 digits (odd number of digits). 
  • 2 contains 1 digit (odd number of digits). 
  • 6 contains 1 digit (odd number of digits). 
  • 7896 contains 4 digits (even number of digits). 
  • Therefore only 12 and 7896 contain an even number of digits.

May 06, 2020

#NarasimhaJayanti:рд░ौрдж्рд░ рдирд╣ीं рд╕ौрдо्рдп рднी рд╣ै рдирд░рд╕िंрд╣

рдЖрдЬ рд╡ैрд╢ाрдЦ рдоाрд╕ рдХे рд╢ुрдХ्рд▓ рдкрдХ्рд╖ рдХी рдЪрддुрд░्рджрд╢ी рд╣ै। рдХрд╣рддे рд╣ै рдЖрдЬ рд╣ी рдХे рджिрди рднрдЧрд╡ाрди् рд╡िрд╖्рдгु рдиे рдирд░рд╕िंрд╣ рдЕрд╡рддाрд░ рд▓िрдпा рдеा, рдЗрд╕ीрд▓िрдП рдЖрдЬ рдХा рджिрди рдирд░рд╕िंрд╣ рдЬрдпंрддी рдХे рд░ूрдк рдоें рдмрдиाрдпा рдЬाрддा рд╣ै।

рдоुрдЭे рдмрдЪрдкрди рд╕े рдпे рдЕрд╡рддाрд░ рдеोреЬा рднрдпाрдирдХ рд▓рдЧा рдХ्рдпूंрдХि рд╣рд░ рдЬрдЧрд╣ рдирд░рд╕िंрд╣ рдЬी рдХा рд╕िрд░्рдл рд░ौрдж्рд░ рд░ूрдк  рджेрдЦा। рдХрд░ीрдм рдХрд░ीрдм рдПрдХ рджрд╢рдХ рдкрд╣рд▓े рдЬрдм рдоैं рдЬुрд╣ू рдХे рдЗрд╕्рдХॉрди рдЯेрдо्рдкрд▓ рдЧрдпा рддрдм рд╡рд╣ाँ рдПрдХ рдЫोрдЯे рдмрдЪ्рдЪे рдХो рд░ोрддे рд╣ुрдП рджेрдЦा, рд╡ो рдирд░рд╕िंрд╣ рдХे рднрдпाрд╡рд╣  рд░ूрдк рд╡ाрд▓ी рдоूрд░्рддि рджेрдЦрдХрд░ рдбрд░ рдЧрдпा рдеा।

"рдбрд░рддे рдирд╣ीं рдмेрдЯा рдпे рднрдЧрд╡ाрди् рд╣ै," рдмрдЪ्рдЪे рдХी рдоाँ рдЙрд╕рд╕े рдпे рдХрд╣рдХрд░ рдЪुрдк рдХрд░ा рд░рд╣ी рд╣ी ।

"рдирд░рд╕िंрд╣ рд░ूрдк рджेрдЦрдХे рдбрд░ рддो рд╕्рд╡ाрднाрд╡िрдХ рд╣ै," рдоेрд░े рдоुँрд╣ рд╕े рд╕рд╣рд╕ा рдиिрдХрд▓ рдкреЬा ।

рд╕ाрде рд╣ी рдЦреЬे рдПрдХ рдЙрдо्рд░ рджрд░ाреЫ рд╢рдЦ्рд╕ рдиे рдоुрд╕्рдХुрд░ाрддे рд╣ुрдП рдХрд╣ा, "рд╕्рд╡ाрднाрд╡िрдХ рдирд╣ीं рд╣ै। рдирд░рд╕िंрд╣ рдЕрд╡рддाрд░ рджेрдЦрдХрд░ рддो рдмिрд▓рдХुрд▓ рднी рдирд╣ीं ।"

#LeetCode:Majority Element

Given an array of size n, find the majority element. The majority element is the element that appears more than n/2 times. You may assume that the array is non-empty and the majority element always exist in the array.

Example 1:
Input: [3,2,3]
Output: 3

Example 2:
Input: [2,2,1,1,1,2,2]
Output: 2

May 05, 2020

#SpringSecurity: OAuth2 Implementation with Spring Boot

In this tutorial we will learn to build an authorization server using oauth2 to authenticate user's identity to provide access_token. This access_token will be used to request data from resource server.

We will be creating an authorization server and embedding the resource server inside authorization server. Authorization server will generate the tokens and resource server will validate these token.

We will be having two services, first one would be authorization server (along with resource server) and the second one would be a client, from which we will be accessing the servers.

#Ramayan: рдХ्рдпा рд░ाрдо рдиे рдЦाрдпे рдеे рд╢рдмрд░ी рдХे рдЭूрдаे рдмेрд░?

рд░ाрдоाрдиंрдж рд╕ाрдЧрд░ рдХी рд░ाрдоाрдпрдг рдоें рд╢рдмрд░ी рдХे рд░ाрдо рдоिрд▓ाрди рд╡ाрд▓ा рдПрдкिрд╕ोрдб Youtube рдкे рджेрдЦ рд░рд╣ा рдеा। рд░ाрдоाрдиंрдж рдЬी рдиे рд░ाрдордХрдеा рдмрд╣ुрдд рд╕ाреЮ, рд╕рд╣рдЬ, рдФрд░ рджिрд▓ рдЫू рд▓ेрдиे рд╡ाрд▓े рднाрд╡ рд╕े рдмрдиाрдпी рд╣ै, рдкрд░ рд╢рдмрд░ी рд╡ाрд▓ा рдПрдкिрд╕ोрдб рдеोреЬा рдеोреЬा рдЖँрдЦों рдоें рдЪुрдмрддा рд╣ै।

рд╢рдмрд░ी рдХрд╣рддी рд╣ै "рд╣े рд░ाрдо рдоुрдЭे рдиीрдЪ рдХुрд▓ рдоें рдЙрдд्рдд्рдкрди рдпे рд╢рд░ीрд░ рдЫोреЬрдиे рдХी рдЖрдЬ्рдЮा рджेрдиे рд╕े рдкрд╣рд▓े рдоुрдЭे рднрдХ्рддि рдХा рдЬ्рдЮाрди рдк्рд░рджाрди рдХрд░ो рдк्рд░рднु।" рдЙрд╕рдХे рдмाрдж рд░ाрдо рд╢рдмрд░ी рдХो рдирд╡рджा рднрдХ्рддि рдХे рдмाрд░े рдоें рдмрддाрддे рд╣ै।

рд░ाрдоाрдиंрдж рдХी рд░ाрдоाрдпрдг рдХे рдордЦрдорд▓ी рдХ़ाрд▓ीрди рдЬैрд╕ी рд▓рдЧрддी рд╣ै। рд╢рдмрд░ी рдХा рдмाрд░ рдмाрд░ рдЦुрдж рдХो 'рдиीрдЪ' рдХрд╣рдиे рд╡ाрд▓े рд╕ंрд╡ाрдж рдЗрд╕ рдордЦрдорд▓ी рдХ़ाрд▓ीрди рдкрд░ рдЯाрдЯ рдХे рдкैрдмंрдж рдЬैрд╕े рд▓рдЧрддे рд╣ै।

#LeetCode: First Unique Character in a String

Given a string, find the first non-repeating character in it and return it's index. If it doesn't exist, return -1.

Examples:
s = "leetcode"
return 0.

s = "loveleetcode",
return 2.

May 04, 2020

#LeetCode: Max Consecutive Ones

Given a binary array, find the maximum number of consecutive 1s in this array.

Example 1:
Input: [1,1,0,1,1,1]
Output: 3

Explanation: The first two digits or the last three digits are consecutive 1s. The maximum number of consecutive 1s is 3.

Note:
The input array will only contain 0 and 1.
The length of input array is a positive integer and will not exceed 10,000

#LeetCode: Number Complement

Given a positive integer, output its complement number. The complement strategy is to flip the bits of its binary representation.

Example 1:
Input: 5
Output: 2
Explanation: The binary representation of 5 is 101 (no leading zero bits), and its complement is 010. So you need to output 2.

#SpringSecurity: What is the difference between access and refresh token?

Access Token
  • An access token is a string representing an authorization issued to the client. Tokens represent specific scopes and duration of access, granted by the resource owner, and enforced by the resource server and authorization server.
  • An access token is put in the Authorization header of our request and it usually looks like 'Bearer h090Yuuyuiyv'. It is verified by the API, which the client is calling.
  • Access token are usually in JWT format, but you can use any other format.
  • Access tokens are usually short lived, because it is difficult (although not impossible) to centrally revoke access tokens.
  • The responsibility of access token is to access data before it gets expired.

#SpringSecurity:Oauth 2.0 Roles

OAuth 2 is an authorization method to provide access to protected resources over the HTTP protocol.

It enables a third-party application to obtain limited access to an HTTP service:
a). Either on behalf of a resource owner by orchestrating an approval interaction between the resource owner and the HTTP service
b). Or by allowing the third-party application to obtain access on its own behalf.

May 03, 2020

#LeetCode: Ransom Note

Given an arbitrary ransom note string and another string containing letters from all the magazines, write a function that will return true if the ransom note can be constructed from the magazines ; otherwise, it will return false.

Each letter in the magazine string can only be used once in your ransom note.

May 02, 2020

#LeetCode: Jewels and Stones

You're given strings J representing the types of stones that are jewels, and S representing the stones you have.  Each character in S is a type of stone you have.  You want to know how many of the stones you have are also jewels.

The letters in J are guaranteed distinct, and all characters in J and S are letters. Letters are case sensitive, so "a" is considered a different type of stone from "A".

#Ramayan: рдХैрд╕े рд╣ुрдЖ рдеा рд╕ीрддा рдХा рдЬрди्рдо?

рдЖрдЬ рдмैрд╕ाрдЦ рдоाрд╕ рдХे рд╢ुрдХ्рд▓ рдкрдХ्рд╖ рдХी рдирд╡рдоी рддिрдеि рд╣ै, рдкौрд░ाрдгिрдХ рдЧ्рд░ंрдеों рдХे рдЕрдиुрд╕ाрд░ рдЖрдЬ рдХे рджिрди рд╕ीрддा рдХी рдЙрдд्рдкрдд्рддि рд╣ुрдИ рдеी।

рдЖрдЬ рдХрд╣ी рдкреЭा 'рдзाрд░्рдоिрдХ рдоाрди्рдпрддा рд╣ै рдХि рдЗрд╕ рджिрди рдк्рд░рднु рд╢्рд░ीрд░ाрдо рдФрд░ рдоाрддा рдЬाрдирдХी рдХो рд╡िрдзि-рд╡िрдзाрди рдкूрд░्рд╡рдХ рдкूрдЬा рдЖрд░ाрдзрдиा рдХрд░рдиे рд╕े рд╡्рд░рддी рдХो рдЕрдоोрдШ рдлрд▓ рдХी рдк्рд░ाрдк्рддि рд╣ोрддी рд╣ै рд╕ाрде рд╣ी рд╡्рд░рддी рдХो рдордиोрд╡ांрдЫिрдд рдлрд▓ों рдХी рднी рдк्рд░ाрдк्рддि рд╣ोрддी рд╣ै'। 

рдеोреЬा рд╣ाрд╕्рдпाрд╕्рдкрдж рд▓рдЧा, рдЬрди्рдорджिрди рд╕ीрддा рдХा рдФрд░ рдкूрдЬा рд░ाрдо рдХे рд╕ाрде? рдмрддाрдпे реЫрд░ा рдХ्рдпा рдРрд╕ी рдХोрдИ рдзाрд░्рдоिрдХ рдоाрди्рдпрддा рд╣ै рдЬो рдХрд╣рддी рд╣ो рд░ाрдо рдирд╡рдоी рдХे рджिрди рд░ाрдо-рд╕ीрддा рдХी рдкूрдЬा рдпा рдлिрд░ рдЬрди्рдоाрд╖्рдЯрдоी рдХे рджिрди рдХृрд╖्рдгा рдХे рд╕ाрде рд░ाрдзा рдХी рдЖрд░ाрдзрдиा рдХрд░рдиा рдЪाрд╣िрдП? рдЦैрд░ рдЬाрдиे рджीрдЬिрдпे, рдкुрд░ुрд╖ рдк्рд░рдзाрди рд╕рдоाрдЬ рдоें рдРрд╕ा рдоुрдордХिрди рдХрд╣ा?

рдХрднी рд╕рдордп рдоिрд▓े рддो рд╡ाрд▓्рдоीрдХि рд░ाрдоाрдпрдг рдкреЭिрдпेрдЧा, рдкुрд░ुрд╖ рдк्рд░рдзाрдирддा рдХी рдЕрдиेрдХ рдоिрд╕ाрд▓ рдоिрд▓ рдЬाрдпेрдЧी।

рд╢ाрдпрдж рдЗрд╕ीрд▓िрдП рд╡ाрд▓्рдоीрдХि рдЬी рдиे рд╕рд░्рдЧ ремрем(рдЫिрдпाрд╕рда) рдоें рд╕िрд░्рдл рджो рд╢्рд▓ोрдХो (резрей-резрек) рдоें рд╕ीрддा рдХी рдЙрдд्рдкрдд्рддि рдХे рдмाрд░े рдоें рд╕ंрдХ्рд╖ेрдк рдоें рд╡рд░्рдгрди рдХिрдпा рд╣ै, рд╣рд▓ाрдХि рд░ाрдо рдЬрди्рдо рд╡िрд╕्рддाрд░ рдоें рдмрддाрдпा рдЧрдпा рд╣ै।

May 01, 2020

#LeetCode: First Bad Version

You are a product manager and currently leading a team to develop a new product. Unfortunately, the latest version of your product fails the quality check. Since each version is developed based on the previous version, all the versions after a bad version are also bad.

Suppose you have n versions [1, 2, ..., n] and you want to find out the first bad one, which causes all the following ones to be bad.

You are given an API bool isBadVersion(version) which will return whether version is bad. Implement a function to find the first bad version. You should minimize the number of calls to the API.

Jai Maharashtra says Amrita Rao

Actress Amrita Rao who prides in been born and brought up in Mumbai, took time during the lockdown for her special salutations to the State on the occasion of Maharashtra Day. May 1st is annually marked to commemorate the creation of Maharashtra from the State of Bombay on May 1, in the year 1960.

Memorable on-screen characters played by birthday-girl Anushka Sharma

Over the years, the Hindi film industry has been consistently blessed with some exceptionally talented artists and one such mention-worthy name is Anushka Sharma. She made her quintessential debut with  Shah Rukh Khan in Rab Ne Bana Di Jodi and has not looked back ever since. From conning a con artist in Ladies vs. Ricky Bahl, to bringing to life a soldier’s story in Jab Tak Hain Jaan and working her magic in Sui Dhaga, Pari, Sulta and Ae Dil Hai Mushkil,  the actress has secured a special place in the viewers’ hearts with her commendable, versatile performance. She recently announced her digital debut as producer of upcoming Amazon Original Series Paatal Lok that is set to release on 15th May.