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
| """Main agent orchestrator for regression analysis.""" | |
| import logging | |
| from typing import Optional | |
| from regression_analyser.github_client import GitHubClient | |
| from regression_analyser.code_analyzer import CodeAnalyzer | |
| from regression_analyser.endpoint_mapper import EndpointMapper | |
| from regression_analyser.ai_agent import RegressionAnalyzerAgent | |
| from regression_analyser.comment_formatter import CommentFormatter |
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
| """ | |
| You are given an array A containing N integers. Your task is to find all subarrays whose average sum is greater than | |
| the average sum of the remaining array elements. You must return the start and end index of each subarray in sorted | |
| order. | |
| A subarray that starts at position L1 and ends at position R1 comes before a subarray that starts at L2 and ends at R2 | |
| if L1 < L2, or if L1 = L2 and R1 ≤ R2. | |
| Note that we'll define the average sum of an empty array to be 0, and we'll define the indices of the array (for the | |
| purpose of output) to be 1 through N. A subarray that contains a single element will have L1 = R1. | |
| Signature |
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
| from abc import ABCMeta, abstractmethod | |
| from enum import Enum | |
| from typing import List, Optional | |
| # Enum Definitions | |
| RoomStyle = Enum("RoomStyle", "STANDARD DELUX SUITE") | |
| RoomStatus = Enum("RoomStatus", "AVAILABLE RESERVED NOT_AVAILABLE OCCUPIED SERVICE_IN_PROGRESS") | |
| BookingStatus = Enum("BookingStatus", "PENDING CONFIRMED CANCELED") | |
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 time | |
| import uuid | |
| class PrintRandom(object): | |
| def execute(self) -> None: | |
| while True: | |
| self.print_number(uuid.uuid1().int) | |
| time.sleep(1) |
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
| <?php | |
| include("Lib.php"); | |
| class ImageResizerMultiProcess | |
| { | |
| private $sizes = []; | |
| public function setSizes($sizes) | |
| { |
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
| # Shoot off 300 requests at the server, with a concurrency level of 10, to test the number of requests it can handle per second | |
| # -p POST | |
| # -H Authentication headers | |
| # -T Content-Type | |
| # -c Concurrent clients | |
| # -n Number of requests to run | |
| # -l Accept variable document length | |
| # -k Connection keep-alive | |
| # -v Verbosity level |
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
| """ | |
| Given a node in a binary search tree, find the in-order successor of that node in the BST. If that node has no | |
| in-order successor, return null. | |
| The successor of a node is the node with the smallest key greater than node.val. | |
| You will have direct access to the node but not to the root of the tree. Each node will have a reference to its | |
| parent node. Below is the definition for Node: | |
| class Node { |
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
| """ | |
| Given an array arr of distinct integers and a nonnegative integer k, write a function findPairsWithGivenDifference that | |
| returns an array of all pairs [x,y] in arr, such that x - y = k. If no such pairs exist, return an empty array. | |
| Note: the order of the pairs in the output array should maintain the order of the y element in the original array. | |
| input: arr = [0, -1, -2, 2, 1], k = 1 | |
| output: [[1, 0], [0, -1], [-1, -2], [2, 1]] | |
| input: arr = [1, 7, 5, 3, 32, 17, 12], k = 17 | |
| output: [] |
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
| /** | |
| * Implementation of stack using Linked list | |
| * Average Time Complexity | |
| * Insert/delete Θ(1) | |
| * Search Θ(n) | |
| * Space complexity: O(n) | |
| */ | |
| #include <cstdlib> | |
| #include <stdio.h> | |
| #include <malloc.h> |
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
| """ | |
| There is a binary tree with N nodes. You are viewing the tree from its left side and can see only the leftmost nodes | |
| at each level. Return the number of visible nodes. | |
| Note: You can see only the leftmost nodes, but that doesn't mean they have to be left nodes. The leftmost node at a | |
| level could be a right node. | |
| Signature | |
| int visibleNodes(Node root) { | |
| Input |
NewerOlder