| Security Measure | Description | |
|---|---|---|
| ☐ | Use HTTPS everywhere | Prevents basic eavesdropping and man-in-the-middle attacks |
| ☐ | Input validation and sanitization | Prevents XSS attacks by validating all user inputs |
| ☐ | Don't store sensitive data in the browser | No secrets in localStorage or client-side code |
| ☐ | CSRF protection | Implement anti-CSRF tokens for forms and state-changing requests |
| ☐ | Never expose API keys in frontend | API credentials should always remain server-side |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| import anthropic | |
| import os | |
| import sys | |
| from termcolor import colored | |
| from dotenv import load_dotenv | |
| class ClaudeAgent: | |
| def __init__(self, api_key=None, model="claude-3-7-sonnet-20250219", max_tokens=4000): | |
| """Initialize the Claude agent with API key and model.""" |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| def is_valid_state(state): | |
| # check if it is a valid solution | |
| return True | |
| def get_candidates(state): | |
| return [] | |
| def search(state, solutions): | |
| if is_valid_state(state): | |
| solutions.append(state.copy()) |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution: | |
| def maxArea(self, h: int, w: int, horizontalCuts: List[int], verticalCuts: List[int]) -> int: | |
| start, end = 0, 0 | |
| max_h, max_w = 0, 0 | |
| horizontalCuts.sort() | |
| verticalCuts.sort() | |
| for i in range(len(horizontalCuts)): |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution: | |
| def isInterleave(self, s1: str, s2: str, s3: str, memo: dict = {}) -> bool: | |
| if len(s1) + len(s2) is not len(s3): | |
| return False | |
| if not s1 and not s2 and not s3: | |
| return True | |
| if (s1,s2,s3) in memo: | |
| return memo[(s1,s2,s3)] | |
| if (s1,s2,s3) not in memo: | |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution: | |
| def evalRPN(self, tokens: List[str]) -> int: | |
| operators = { | |
| "+": (lambda a, b: a + b), | |
| "-": (lambda a, b: a - b), | |
| "*": (lambda a, b: a * b), | |
| "/": (lambda a, b: a / b) | |
| } | |
| tkn_stack = [] |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| class Solution: | |
| def minPartitions(self, n: str) -> int: | |
| for i in range(9, -1, -1): | |
| if str(i) in n: | |
| return i |