Posts

Determine if String Halves Are Alike

You are given a string   s   of even length. Split this string into two halves of equal lengths, and let   a   be the first half and   b   be the second half. Two strings are  alike  if they have the same number of vowels ( 'a' ,  'e' ,  'i' ,  'o' ,  'u' ,  'A' ,  'E' ,  'I' ,  'O' ,  'U' ). Notice that  s  contains uppercase and lowercase letters. Return  true  if  a  and  b  are  alike . Otherwise, return  false . Example 1: Input: s = "book" Output: true Explanation:  a = "b o " and b = " o k". a has 1 vowel and b has 1 vowel. Therefore, they are alike. Example 2: Input: s = "textbook" Output: false Explanation:  a = "t e xt" and b = "b oo k". a has 1 vowel whereas b has 2. Therefore, they are not alike. Notice that the vowel o is counted twice. Example 3: Input: s = "MerryChristmas" Output: false

Agile Principles

Image
In the previous article, we learned about Agile Manifesto . Here, in this article we are going to note down the principles of agile . Source: Google Principles of Agile: Satisfy Customer through early and continuous delivery. Welcome, change requirement even in late development. Deliver working software frequently [ i.e., couple of weeks to couple of months ] Business people and developers work together daily. Build projects under motivated individuals.[ Give each individual, a required environment, support they need and trust them to get the job done ] Convey information to developer team through face to face conversation. Working software is a primary progress. Promote sustainable development. Developer and Customer should develop constant pace indefinitely. Continuous attention for technical enhances and good design. Simplicity - art of maximising amount of not work done is essential. Best architectures, requirement, design, emerging from self organizing teams. At regular intervals,

Balanced Binary Tree

Image
Given a binary tree, determine if it is height-balanced. For this problem, a height-balanced binary tree is defined as: a binary tree in which the left and right subtrees of  every  node differ in height by no more than 1. Example 1: Input: root = [3,9,20,null,null,15,7] Output: true Example 2: Input: root = [1,2,2,3,3,null,null,4,4] Output: false Example 3: Input: root = [] Output: true   Constraints: The number of nodes in the tree is in the range  [0, 5000] . -10 4  <= Node.val <= 10 4 Solution: /**  * 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;  *     }

Smallest Range II

Given an array   A   of integers, for each integer   A[i]   we need to choose   either  x = -K  or  x = K , and add   x   to   A[i]  (only once) . After this process, we have some array  B . Return the smallest possible difference between the maximum value of  B  and the minimum value of  B . Example 1: Input: A = [1] , K = 0 Output: 0 Explanation : B = [1] Example 2: Input: A = [0,10] , K = 2 Output: 6 Explanation : B = [2,8] Example 3: Input: A = [1,3,6] , K = 3 Output: 3 Explanation : B = [4,6,3] Note: 1 <= A.length <= 10000 0 <= A[i] <= 10000 0 <= K <= 10000 Solution: class Solution {     public int smallestRangeII(int[] A, int K) {         int i, min=0, max=0, min1, min2, max1, max2, length = A.length, diff

Agile Manifesto

Image
In the previous article, we learned about history of Agile . Now, in this article you will find about the Manifesto of Agile  Source: Google Agile Manifesto: Below are the manifesto of Agile., Individuals and Interactions over process and tools Working software over comprehensive documentation Customer Collaboration over contract negotiation Responding to the change over following the plan. Also read: Principles of Agile Related Posts: List of all Leetcode Problems with Solutions and Explanation  Explore more on our blog Agile Contents Like us? Please do share with your friends ..!! Follow us to receive updates instantly. If you have any feedback/suggestions, leave it in a comment section which will be helpful for us to improve.

Agile History

Image
In this chapter, we are going to learn about Agile. Here, we discussed about few points which we will give you a history and evolution of agile. In whole learning most of the articles are written as points or notes, so that anyone can understand and learn easily. Source: Google Agile can be described in many ways. One among those is, Agile is not a specific model/process, it is a mindset. During early 1990's many of the light weight development models evolved to overcome drawbacks from Waterfall Model, Iterative Model etc. These includes Rapid Application Development (RAD), Unified process etc. After few years, around 2001, seventeen software developers together met at resort in Snowbird , Utah to discuss about Lightweight development model . These developers includes: Kent Beck, Dave Thomas, Ward Cunningham, Jeff Sutherland, Steve Mellor, Jon Kern, Brian Marick, Ken Schwaber, Jim Highsmith, Ron Jeffries, Andrew Hunt, James Grenning, Martin Fowler, Arie van Bennekum, Mike Beedle, R