Блог пользователя Reconciliation

Автор Reconciliation, 3 года назад, По-английски

Given a string of 1’s and 2’s, standing at index ‘i’, you can move exactly two steps forward or backward if s[i] == 2, else you can move one step forward or backward if s[i] ==1. A string is called a good string if you can reach the end of the string by moving every index exactly once.

Now, you have been given two Strings A and B (not necessarily good), you have to return the number of possible sub-sequences of swaps available, such that both the strings become good.

Swap means you can swap A[i] with B[i].

Example:

A = 2211 
B = 1111 
ans = 8

Source : https://www.geeksforgeeks.org/media-net-interview-experience-for-sde-1/

Can someone please give some idea on how to solve this?

Полный текст и комментарии »

  • Проголосовать: нравится
  • -8
  • Проголосовать: не нравится

Автор Reconciliation, история, 3 года назад, По-английски

The new Hackerearth Interface looks cool.

However, I don't understand many things. What are the badges? Elite, Legend, Explorer etc, also wtf is Points?

Can someone from Hackerearth provide some explanation for this?

also, please have a discussion fourm like Codechef.

Полный текст и комментарии »

  • Проголосовать: нравится
  • +5
  • Проголосовать: не нравится