Mar-28-2019, 05:27 PM
Take these two strings: '1000004000001' and '100000000333331'
When combined, they should become '1000000400333331'. Of course, the number '3's can on be on the left and right. Also the four should be overwritten if the threes take up too much space.
I currently have this:
Hope this makes sense.
Dream
When combined, they should become '1000000400333331'. Of course, the number '3's can on be on the left and right. Also the four should be overwritten if the threes take up too much space.
I currently have this:
print('here!') for i in range(0,len(other)): if other[i:i+1] == '3': pos = other.index(other[i]) break if pos <= curr.index('4'): temp = True new = new + '1' count = list(other).count('3') char_pos = curr.index('4') if char_pos != 1: for i in range(0,len(curr)-char_pos): new = new + '0' if temp == False: print('jhh') new = new + '4' for j in range(0,count): new = new + '3' new = new + '1''curr' is '1000004000001' and 'other' is a variation of '100000003333331'.
Hope this makes sense.
Dream