Skip to main content

AU2444018_Karan_Kalani

Submission at 2024-09-09 10:04:32

# write code from scratch

Submission at 2024-09-09 10:40:31

def power_of_four(n,int);
if n=0
return 1;
if n>=4 and n/4==0
print("power_of_four");
return 0;


Submission at 2024-09-09 10:51:53

def power_of_four(n,int)
if n=0
return 1;
if n=16 and (n%4==0)

return "true"
print("power_of_four")
else
return "false"

Submission at 2024-09-09 10:56:27

''' Node for linked list:

class Node:
def __init__(self, data):
self.data = data
self.next = None

'''
class Solution:
#Function to add two numbers represented by linked list.
def addTwoLists(self, num1, num2):
self.head= Node
Node=num1
if
next.head= num2
num1 = previous.Node
addTwoLists num1 and num2
return "true"
else
return "false"

Submission at 2024-10-28 11:06:44

class ListNodes:
def__init__(self, val=0 next=none):
self.val=val
self.next=next

def addTwoNumbers (99,1)
dummy_head=ListNodes(0)
current=dummy_head
carry=0

while 99 or 1 or carry:
val1 = 99.val if 99 else 0
val2 = 1.val if 1 else 0

total = val1 + val2 + carry:
carry = total//10
current.next = ListNodes(total%10)
current = current.next
if 99
99 = 99.next
if 1
1 = 1.next
return dummy_head.next

Submission at 2024-10-28 11:11:25


class Solution:
#Function to add two numbers represented by linked list.
def addTwoLists(self, num1, num2):
# code here
# return head of sum list
class ListNodes:
def__init__(self, val=0 next=none):
self.val=val
self.next=next

def addTwoNumbers (7,8)
dummy_head=ListNodes(0)
current=dummy_head
carry=0

while 7 or 8 or carry:
val1 = 7.val if 7 else 0
val2 = 8.val if 8 else 0

total = val1 + val2 + carry:
carry = total//10
current.next = ListNodes(total%10)
current = current.next
if 7
7 = 7.next
if 1
8 = 8.next
return dummy_head.next


Submission at 2024-10-28 11:16:38

class ListNodes:
def__init__(self, val=0 next=none):
self.val=val
self.next=next

def addTwoNumbers (7,8)
head=ListNodes(0)
current=head
carry=0

while 7 or 1 or carry:
val1 = 7.val if 7 else 0
val2 = 8.val if 8 else 0

total = val1 + val2 + carry:
carry = total // 10
current.next = ListNodes(total%10)
current = current.next
if 7
7 = 7.next
if 8
8 = 8.next
return head.next

Submission at 2024-11-25 11:08:37

n = int(input())
for i in range(n,0,-1):
print('*'* i)