Hello...Now I am swapping CS pairs from right to left, so that 6 CSSCS
ouputs 1 now. But though it Fails in the 2nd Test Set. What's the problem ?
I am really stuck at this ! :(
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe
Sorry for pasting all the code herebut though have a look..
def isCapable(s, able):
#finds if a beam is capable of withstanding "able"
charge = 1
damage = 0
for step in s:
if step == "S":
damage += charge
if step == "C":
charge *= 2
https://github.com/Sonu64/saving_the_universe_again/
Check out the code in my GitHub Repo please :)
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-c
I was trying a different approach, it makes slices of the sorted list and
then checks if its possible or not
def findSol(arr, budget):
if min(arr) > budget:
return 0
arr.sort()
for i in range(len(arr)-1, -1, -1):
temp = arr[0:i]
temp2 = arr[0:i+1]
#prin
And this one gives WA as wellWHY ?? This one is really making me mad
def findSol(arr, budget):
arr.sort()
total = 0
count = 0
for i in range(0, len(arr)):
total += arr[i]
if total <= budget:
count += 1
else:
return count
de
Thanks a Lot <3 <3 Actually single House was returning NONE, and also it
had some problems with house list like [25,25] with a budget of 50. I fixed
them, but still it gets WA. Ohh..gosh !
def findSol(arr, budget):
if len(arr) == 1 and sum(arr) <= budget:
return 1
arr.sort()
It worked ! Thank You guys ! :)
--
You received this message because you are subscribed to the Google Groups
"Google Code Jam" group.
To unsubscribe from this group and stop receiving emails from it, send an email
to google-code+unsubscr...@googlegroups.com.
To view this discussion on the web v
It fulfills the criteria . For sure, in a question asked about the
Indicium problem, Google answered that their 2 possible combinations are
not the Only possible combinations..Their can be a lot more.
On Tue, Apr 7, 2020, 10:26 PM krishnasys wrote:
> I have been trying to solve this problem