Skip to content

akalai/test

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

3 Commits
 
 

Repository files navigation

test please ignore

Example 1

from typing import List

def puzzle(moves: List[List[int]]):   
    rods = ([8, 7, 6, 5, 4, 3, 2, 1], [], []) 
    for [i, j] in moves: 
        rods[j].append(rods[i].pop()) 
        assert rods[j][-1] == min(rods[j]), "larger disk on top of smaller disk" 
    return rods == ([], [], [8, 7, 6, 5, 4, 3, 2, 1]) 

def solution(): 
    moves = [] 
    def f(n, source, temp, dest): 
        if n > 0: 
            f(n - 1, source, dest, temp) 
            moves.append([source, dest]) 
            f(n - 1, temp, source, dest) 
    f(8, 0, 1, 2) 
    return moves   

Example 2

def puzzle(s: str): 
    return s.count('A') == 1000 and s.count('AA') == 0  

def solution(): 
    return 'AB' * 1000   

Example 3

def puzzle(i: int, n=241864633):     
    return 1 < i < n and n % i == 0  
  
def solution(n=241864633): 
    for i in range(2, int(n ** 0.5) + 1): 
        if n % i == 0: 
            return i  

About

test of markdown code

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published