en
Feedback
Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO

Coding | EXAMS | IBM ACCENTURE | VIRTUSA | IBM | AMAZON | TCS | EPAM | WILEY EDGE | TECH MAHINDRA | JPMORGAN | HCL | WIPRO

Open in Telegram

Main channel https://t.me/Coding_000 Contact Admin 👉 @ILOVEU_143 for booking your exam slots Web- https://coding000.github.io/Projects/ 💯% clearance in any placement exams OffCampus -https://t.me/Offcampus_000 Discussion- https://t.me/exams_discussion

Show more
3 343
Subscribers
-424 hours
-187 days
-5230 days
Posts Archive
from itertools import permutations def count(arr): z=[] perm = permutations(arr) for i in list(perm): z.append(list(i)) q=[]
from itertools import permutations def count(arr):     z=[]     perm = permutations(arr)          for i in list(perm):         z.append(list(i))     q=[]          for i in range(len(arr)-1):         x,y=arr[i],arr[i+1]                  for j in range(len(z)):             if z[j].index(x)!=len(z[j])-1:                 if z[j][z[j].index(x)+1]==y:                     q.append(z[j])                          for i in range(len(q)):          if q[i] in z:              z.remove(q[i])     return len(z) a= int(input()) b=list(map(int,input().strip().split())) print(count(b)) Python Telegram - @Coding_000

Share this link to big groups and your friends 👍 I will try to post all codes here All the best❤️

Share this link to big groups and your friends 👍 I will try to post all codes here All the best❤️

Who have exam Share with link to big groups and your friends 👍 I will try to post all codes here All the best❤️ @Coding_000

Join MORE  people tmr we will try to send the coding solutions INFOSYS 😊✅ ✅✅✅✅✅SHARE✅✅✅              @Coding_000

class Solution:     def helper1(self, n, arr, k, a, b):         root = arr[0]         mini = min(arr)         for i in range(1, n):             num = arr[i]             if root + num > k:                 if root + mini > k:                     arr[i] = 0                     return b         return 0             def helper2(self, n, arr, k, a, b):         cost = self.helper1(n, arr, k, a, b)         mini = min(arr)         root = arr[0]         for i in range(1, n):             num = arr[i]             if root + num > k:                 if root + mini <= k:                     cost += min(a, b)                 elif root <= k:                     cost += b                 else:                     return -1         return cost             def solve(self, n, Par, arr, k, a, b):         arr1 = [min(arr)] + arr[1:]         arr2 = [0] + arr[1:]         cost1 = self.helper2(n, arr, k, a, b)         cost2 = self.helper2(n, arr1, k, a, b)         cost3 = self.helper2(n, arr2, k, a, b)         data = []         if cost1 >= 0:             data.append(cost1)         if cost2 >= 0:             data.append(cost2 + a)         if cost3 >= 0:             data.append(cost3 + b)         return min(data) @Coding_000 💯 Working