Skip to main content

Posts

Showing posts from February, 2021

Paper Analysis | JEE Mains 2021

The National Testing Agency (NTA) has successfully conducted shift 1 of JEE Main 2021 February 26 paper. The JEE Main 2021 shift 1 paper was held from 09 AM to 12 PM. Students who appeared in the JEE Main 2021 February 26 shift 1 found the paper moderate in difficulty level. Most students found the paper easy as compared to previous shifts of JEE Main 2021. Physics Most questions were from class 11 part, few questions from electrostatics of class 12. The overall difficulty level was moderate. Electrostatic - 3 questions Current electricity AC circuit - 1 questions Optics - 2 questions Modern physics -1 questions Semiconductor - 1 questions Communication system -1 questions Error & measurements - 1 questions Rotation - 1 questions Thermodynamics - 2 questions Chemistry Questions were mostly from organic and p-block. Physical part questions were difficult and many questions were from class 11 part. The overall difficulty was easy. Inorganic chemistry again more questions s & p

Release of Admit Card | JEE Mains 2021

The National Testing Agency will be conducting the Joint Entrance Examination (Main) February – 2021 in Computer Based Test (CBT) mode at different centers located in 331 cities throughout the country and abroad from 23rd to 26th February 2021.  For Full Notice: Click here... The candidates can download their Admit Cards from the website jeemain.nta.nic.in w.e.f. February 11, 2021 (Thursday).  The candidates are advised to download their Admit Card of Joint Entrance Examination (Main), February 2021 (using their Application No and Date of Birth) along with the undertaking ofJEE (Main) February – 2021 and go through the instructions contained therein as well as in the Information Bulletin.  In case any candidate faces difficulty in downloading the Admit Card along with an undertaking, he/she can contact on 0120-6895200 or mail at jeemain@nta.ac.in .  For more updates or the latest news keep visiting the website of NTA www.nta.ac.in and jeemain.nta.nic.in   The candidates may note that

Reverse String | LeetCode

  Write a function that reverses a string. The input string is given as an array of characters   char[] . Do not allocate extra space for another array, you must do this by  modifying the input array  in-place  with O(1) extra memory. You may assume all the characters consist of  printable ascii characters .   Example 1: Input: ["h","e","l","l","o"] Output: ["o","l","l","e","h"] Example 2: Input: ["H","a","n","n","a","h"] Output: ["h","a","n","n","a","H"] Solution: class Solution { public: void reverseString(vector<char>& s) { int i =0, n = s.size() - 1; char ch; while(i<n){ ch = s[i]; s[i] = s[n]; s[n] = ch; ++i; --n; } } };

Duplicate Zeros | LeetCode

Given a fixed-length array   arr   of integers, duplicate each occurrence of zero, shifting the remaining elements to the right. Note that elements beyond the length of the original array are not written. Do the above modifications to the input array  in place , do not return anything from your function.   Example 1: Input: [1,0,2,3,0,4,5,0] Output: null Explanation: After calling your function, the input array is modified to: [1,0,0,2,3,0,0,4] Example 2: Input: [1,2,3] Output: null Explanation: After calling your function, the input array is modified to: [1,2,3]   Note: 1 <= arr.length <= 10000 0 <= arr[i] <= 9 Solution: class Solution { public:     void duplicateZeros(vector<int>& arr) {         int len = arr.size();         for(int i=0;i< len; ++i){             if(arr[i] == 0){                 for(int j = len - 1;j > i; --j)                               arr[j] = arr[j-1];                                                     ++i;             }       

Squares of a Sorted Array | LeetCode

  Given an integer array   nums   sorted in   non-decreasing   order, return   an array of  the squares of each number  sorted in non-decreasing order .   Example 1: Input: nums = [-4,-1,0,3,10] Output: [0,1,9,16,100] Explanation: After squaring, the array becomes [16,1,0,9,100]. After sorting, it becomes [0,1,9,16,100]. Example 2: Input: nums = [-7,-3,2,3,11] Output: [4,9,9,49,121]   Constraints: 1 <= nums.length <=  10 4 -10 4  <= nums[i] <= 10 4 nums  is sorted in  non-decreasing  order.   Follow up:  Squaring each element and sorting the new array is very trivial, could you find an  O(n)  solution using a different approach? Solutions: class Solution { public:     vector<int> sortedSquares(vector<int>& nums) {         int len = nums.size();         for(int i = 0; i < len; ++i){             nums[i] = nums[i] * nums[i];         }                  sort(nums.begin(),nums.end());                  return nums;     } }; Question for practice  

Find Numbers with Even Number of Digits | LeetCode

  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. Example 2: Input: nums = [555,901,482,1771] Output: 1 Explanation: Only 1771 contains an even number of digits.   Constraints: 1 <= nums.length <= 500 1 <= nums[i] <= 10^5 Solution: class Solution { public:     int findNumbers(vector<int>& nums) {         int evenNumber = 0, count;                  for(auto i: nums){             count = 0;             while(i != 0){                 i /= 10;                                 ++count;                             }             if(count % 2 == 0)                 ++

Max Consecutive Ones | LeetCode

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 the input array is a positive integer and will not exceed 10,000 Question from LeetCode Solutions: class Solution { public:     int findMaxConsecutiveOnes(vector<int>& nums) {         int maxOnes = 0, count = 0;         for(auto i : nums){             if(i == 1){                 ++count;             }else{                                count = 0;             }             if(count > maxOnes)                 maxOnes = count;         }         return maxOnes;     } };   Question for practice

Demonetisation was good or bad | Essay Writing

Demonetization is the process of devaluing a piece of currency to zero. In other words, changing the value of a particular denomination of currency to nil. Making it a piece of paper with absolutely no value greater than a regular piece of paper. We can judge the decision of Demonetization by the Government based on the industries that get affected the most by it. Firstly, the small retail shops, which thrive on cash flow and don’t really have the facility of Swipe Machines, including the small vendors who sell vegetables and fruits on the street. Apart from this, the industry which gets hit the most is certainly Real Estate. So here’s a little on the impact on the Real Estate industry. It is a known fact that a big chunk of real estate runs on cash. Most of it in black as well. But some of the points that need to be noted are that many people who were all ready for their investment post 8th November have now either just stopped in their tracks and reconsidering or have just scrapped t