ogfemboy's blog

By ogfemboy, history, 4 months ago, In English

guys sorry for the bad formating yesterday

Question 1=>

so you are given an array of integeres, you need to count the maximum number of partiotions that you can do, here partition means dividing the array into 2 parts such that the sum of both parts are equal. In addition to this you can do this operation once, change a number to 0

test case 1=> 6

-1 5 0 0 5 0

answer is 3, here we change -1 to 0

Question 2 => you are given a string of lower case english alphabets, you need to find the numbebr of palindromic triplets, A palindromic triplets is as such, suppose you have 3 non overlapping substring S1,s2,s3 then this triplet is a plaindromic triplet if all the individual substrings are palindromes and non overlapping. We need to find the number of such triplets

test case 1=> 4

abaa

answer is 5

Full text and comments »

  • Vote: I like it
  • -16
  • Vote: I do not like it