MCPcopy Create free account
hub / github.com/AlphaGPU/leetgpu-challenges / find_solution_file

Function find_solution_file

scripts/run_challenge.py:29–44  ·  view source on GitHub ↗
(challenge_dir: Path, language: str)

Source from the content-addressed store, hash-verified

27
28
29def find_solution_file(challenge_dir: Path, language: str) -> tuple[str, str]:
30 language_to_extension = {
31 "cuda": "cu",
32 "mojo": "mojo",
33 "pytorch": "py",
34 "cute": "py",
35 "triton": "py",
36 "jax": "py",
37 }
38 solution_file = challenge_dir / "solution" / f"solution.{language_to_extension[language]}"
39 if not solution_file.exists():
40 raise FileNotFoundError(
41 f"No solution file found for {language}. "
42 f"Add a solution/solution.{language_to_extension[language]} file. "
43 )
44 return solution_file.name, solution_file.read_text()
45
46
47def submit_solution(

Callers 1

mainFunction · 0.85

Calls

no outgoing calls

Tested by

no test coverage detected