Posts

Given a string str consisting of only two characters 'a' and 'b'. You need to find the minimum steps required to make the string empty by removing consecutive a's and b's

 Question:  Given a string  str  consisting of only two characters  'a'  and  'b' . You need to find the minimum steps required to make the string empty by removing consecutive  a's  and  b's My CODE(Shows RUNTIME ERROR(take more time than expected)): #include <iostream> #include <string> using namespace std; int ForB(string str,int sizeA,int countA=0,int i=0){     /*if(i==sizeB){         return countB;     }*/      while(i!=sizeA){     if (str[i]=='b' || str[i]=='B'){       if(i!=sizeA-1){         str[i]='X';}       else if (i==sizeA-1){           str[i]='X';           countA++;       }       i++;}       else if((str[i]!='a'||str[i]!='A')&&(/*str[i-1]=='a'||*/  str[i-1]=='X')){         countA++; i++;        }   }   return countA; } int ForA(string str,int sizeA,int countA=0,int i=0){    /* if(i==sizeA){         return countA;     }*/   while(i!=sizeA){     if (str[i]=='a'

#include : Advantages and Disadvantages

Image
 #include <bits/stdc++.h> : Advantages and Disadvantages introduction : It is the header file that prevents chores and helps us to make our coding fast by excluding specific use of header files likewise by including only this file we can use vectors, strings and math operation  and get saves to use a bunch of lines of code  Advantages : This helps when we want to get a high rank in time limit-based coding competition  We don't need to remember lots of the header files  Prevent chores(unwanted jobs) Disadvantages : Due to including all the header files by   #include <bits/stdc++.h>            The compilation time gets increased The size of the file also gets increased  Not considered to be a good practice On every line of need, all headers are in action and the function chooses a specific header file according to the need Can not use this in MSVC(Micro Soft Visual Code) but can in GCC
 int x=1;        vector<int> v;         vector<vector<int> > ans;         int start,end;         for (int i=0;i<n;i++){             if(A[i]<A[i+1]){                 start = i;                 end=endpoint(A,n);                 i=end;                 v.push_back(start);v.push_back(end);                 ans.push_back(v);             }         return ans;

vector & pair : Introduction, Use, Example, Implementation, question

Image
 Vectors and pairs  Vectors vectors Introduction : Vector is an advanced form of an array or can say it is the resolution of drawbacks of arrays while we use it  , if we talk about a definition so; a Vector is a form of an array with a special functionality in this we don't want to pre-define the size of the Vectors, but in the case of the array we need to define the size of this feature makes a vector Dynamic type Vector Definition or what is a vector, answer: A vector is the type of array that automatically define its size along with use or in run time Use : We use vectors when there is no proper surety of the size of the Array Example : if we want to make a dynamic array that automatically states its size ; #include <iostream> #include <vector> int main(){           vector<int> v;           //here v is int type data storing vector            v[0]=433;           v[1]=43;                   // NOTE: We do not define the size of it           cout<<v[1]&

Your subdomain blocks will be promoted to the domain level in three days

Image
  Your subdomain blocks will be promoted to the domain level in three days  Hello friends if you have recieved that email then 100% you have a subdomain account like  This which I have Shivamfrommathura. blogspot.com So from Now the subdomain type website like example :- shivam.hasnode.com or xyz.blogspot.com or abcd.wordpress.com  These all types of websites getting block if they have adsense permission To earn money by ads because Google from now not accepting the subdomain monitisation   Solution You just need to buy a domain like  Xyz.com abcd.net prq.in etc and just need to register it in place of you old domain which is of blogspot.com type  Don't worry they do not delete you blog but after 13 march you can't direct change you subdomain monitisation to domain monitisation and after 20 March the monitisation  for you old subdomain gets cancel ❌ For video clearity click here - Click for YouTube in English Click for YouTube in Hindi

Engineering Mathematics-1 (BAS-103) Sample/PUT Question paper 2023

Image
 Mathematics  Hello friends here is the question paper 📜 which given on our PUT's  To get this in full quality just click here For second page click here  In second page you will get very very very important question and have 70% change to come in exam made by experienced teacher SECTION-A (2Marks each) Q1. Find the symmetry of the curve x^3y^2=x^2-a^2x Q2. if x =rcos@ ,y=rsin@ find del(x,y)/del(r,@) Q3. Find the stationary points of the function x^3y^2(6-x-y) Q4. Is the following matrix orthogonal ? Q5. Evaluate β(2,3/2) Q6. Find the outward normal vector of 2x^3+2xy+y^2=3 at point (1,2,3) Q7. Find the acceleration of the particle moving along curve x=Sint,y=cos2t,z=e^t at (t=2) SECTION-B(3marks each) Q8. Y=xlog(x-1/x+1) show that,  Y =(-1) (n-2)! [(x-n/(x-1)^n)-(x+n/(x+1)^n)]  Q9. Show that rectangular solid of maximum volume that can be inscribed in a given sphere is a cube Q10. Prove that  Γ(m) Γ(m)+1/2=√Ï€/2^(2m-1) Γ(2m) Q11. Find the Eigen Values and Eigen Vectors of A =   Q1

What is a Vector and How to initialize a Vector

 Vector and its Initialization Vector is a Dynamic Array that changes its size on run time, and provides flexibility to use it without initializing the size, but needs to declare the data type like int, string, etc   basic initialization of vector class format vector<data type> vector name ; Ex: vector <int> v1; here in the above example, the vector is initialized with data type int and the name of the vector is v1  let us take another example to initialize the vector  Ex: vector<data type>vector name (initial size, every indexing address value); vector <bool>v2(3,0); here the vector gets initialized from 3 instead of initialized from 0 and here the vector is bool type and all 3 means if  arr1 is an array then  vector <bool>v2(3,0); bool arr[3]={0,0,0} both have the same value but only v2 can be mutable and have a size of 4 in this situation because vectors always have the size in terms of 2**n where n is an integer likewise if the vector v2 gets filled to

Pageviews