PrimeIntellect/SWE-rebench-V2 huggingface dataset:
Repository: JuliaEarth/CoordRefSystems.jl (julia)

Issue:
Add `Cartesian` constructor with tuple of numbers
The current constructors only cover the unitful case or cases with splat.

Pull request:
Now, `Cartesian` constructors accept a tuple of number or a tuple of quantities:
```julia
Cartesian((1.0, 1.0))
Cartesian((1.0u"m", 1.0u"m"))
```
closes #71

Patch:
diff --git a/src/crs/basic.jl b/src/crs/basic.jl
index b5253964..425f16a5 100644
--- a/src/crs/basic.jl
+++ b/src/crs/basic.jl
@@ -12,6 +12,8 @@ abstract type Basic{Datum} <: CRS{Datum} end
 """
     Cartesian(x₁, x₂, ..., xₙ)
     Cartesian{Datum}(x₁, x₂, ..., xₙ)
+    Cartesian((x₁, x₂, ..., xₙ))
+    Cartesian{Datum}((x₁, x₂, ..., xₙ))
 
 N-dimensional Cartesian coordinates `x₁, x₂, ..., xₙ` in length units (default to meter)
 with a given `Datum` (default to `NoDatum`).
@@ -37,9 +39,9 @@ struct Cartesian{Datum,N,L<:Len} <: Basic{Datum}
 end
 
 Cartesian{Datum}(coords::NTuple{N,L}) where {Datum,N,L<:Len} = Cartesian{Datum,N,float(L)}(coords)
-Cartesian{Datum}(coords::L...) where {Datum,L<:Len} = Cartesian{Datum}(coords)
-Cartesian{Datum}(coords::Len...) where {Datum} = Cartesian{Datum}(promote(coords...))
-Cartesian{Datum}(coords::Number...) where {Datum} = Cartesian{Datum}(addunit.(coords, u"m")...)
+Cartesian{Datum}(coords::NTuple{N,Len}) where {Datum,N} = Cartesian{Datum}(promote(coords...))
+Cartesian{Datum}(coords::NTuple{N,Number}) where {Datum,N} = Cartesian{Datum}(addunit.(coords, u"m"))
+Cartesian{Datum}(coords::Number...) where {Datum} = Cartesian{Datum}(coords)
 
 Cartesian(args...) = Cartesian{NoDatum}(args...)
 


Test patch:
diff --git a/test/crs/constructors.jl b/test/crs/constructors.jl
index eef03d77..c7b13f1b 100644
--- a/test/crs/constructors.jl
+++ b/test/crs/constructors.jl
@@ -5,6 +5,9 @@
       @test Cartesian(T(1), T(1)) == Cartesian(T(1) * u"m", T(1) * u"m")
       @test Cartesian(T(1), T(1), T(1)) == Cartesian(T(1) * u"m", T(1) * u"m", T(1) * u"m")
       @test Cartesian(T(1) * u"m", 1 * u"m") == Cartesian(T(1) * u"m", T(1) * u"m")
+      @test Cartesian((T(1), T(1))) == Cartesian((T(1) * u"m", T(1) * u"m"))
+      @test Cartesian((T(1), T(1), T(1))) == Cartesian((T(1) * u"m", T(1) * u"m", T(1) * u"m"))
+      @test Cartesian((T(1) * u"m", 1 * u"m")) == Cartesian((T(1) * u"m", T(1) * u"m"))
 
       c = Cartesian(T(1))
       @test sprint(show, c) == "Cartesian{NoDatum}(x: 1.0 m)"
Repository: JuliaCollections/DataStructures.jl (julia)

Issue:
Absence of merge() in RobinDict
The absence of `merge` method call for RobinDict leads to the following problem. 
```julia
julia> using DataStructures

julia> rd1 = RobinDict()
RobinDict{Any,Any} with 0 entries

julia> for i=1:10
           rd1[i] = 2*i
       end

julia> rd2 = RobinDict()
RobinDict{Any,Any} with 0 entries

julia> for i=11:20
           rd2[i] = 2*i + 1
       end

julia> merge(rd1, rd2)
Dict{Any,Any} with 20 entries:
  18 => 37
  2  => 4
  16 => 33
  11 => 23
  7  => 14
  9  => 18
  10 => 20
  19 => 39
  17 => 35
  8  => 16
  6  => 12
  4  => 8
  3  => 6
  5  => 10
  20 => 41
  13 => 27
  14 => 29
  15 => 31
  12 => 25
  1  => 2
```
`merge(rd1, rd2)` should have been of the type `RobinDict`.

Pull request:
Fixes #626

Patch:
diff --git a/src/robin_dict.jl b/src/robin_dict.jl
index 44dc68c73..6fa31851d 100644
--- a/src/robin_dict.jl
+++ b/src/robin_dict.jl
@@ -1,5 +1,5 @@
 import Base: setindex!, sizehint!, empty!, isempty, length, copy, empty,
-             getindex, getkey, haskey, iterate, @propagate_inbounds,
+             getindex, getkey, haskey, iterate, @propagate_inbounds, merge,
              pop!, delete!, get, get!, isbitstype, in, hashindex, isbitsunion,
              isiterable, dict_with_eltype, KeySet, Callable, _tablesz, filter!
 
@@ -610,3 +610,22 @@ end
 @propagate_inbounds iterate(t::RobinDict, i) = _iterate(t, get_next_filled(t, i))
 
 filter!(f, d::RobinDict) = Base.filter_in_one_pass!(f, d)
+
+function _merge_kvtypes(d, others...)
+    K, V = keytype(d), valtype(d)
+    for other in others
+        K = promote_type(K, keytype(other))
+        V = promote_type(V, valtype(other))
+    end
+    return (K, V)
+end
+
+function merge(d::RobinDict, others::AbstractDict...)
+    K, V = _merge_kvtypes(d, others...)
+    merge!(RobinDict{K,V}(), d, others...)
+end
+
+function merge(combine::Function, d::RobinDict, others::AbstractDict...)
+    K, V = _merge_kvtypes(d, others...)
+    merge!(combine, RobinDict{K,V}(), d, others...)
+end


Test patch:
diff --git a/test/test_robin_dict.jl b/test/test_robin_dict.jl
index 9ddbf8c1d..cb09631fa 100644
--- a/test/test_robin_dict.jl
+++ b/test/test_robin_dict.jl
@@ -359,6 +359,28 @@ end
     @test h.idxfloor == get_idxfloor(h) == 0
 end
 
+@testset "merge" begin
+    h1 = RobinDict("a" => 1, "b" => 2)
+    h2 = RobinDict("c" => 3, "d" => 4)
+    d = merge(h1, h2)
+    @test isa(d, RobinDict{String, Int})
+    @test length(d) == 4
+    @test d["a"] == 1
+    @test d["b"] == 2
+    @test d["c"] == 3
+    @test d["d"] == 4
+end
+
+@testset "merge with combine function" begin
+    h1 = RobinDict("a" => 1, "b" => 2)
+    h2 = RobinDict("b" => 3, "c" => 4)
+    d = merge(+, h1, h2)
+    @test isa(d, RobinDict{String, Int})
+    @test d["b"] == 5
+    @test d["a"] == 1
+    @test d["c"] == 4
+end
+
 @testset "invariants" begin
     h1 = RobinDict{Int, Int}()
     for i in 1:300
Repository: vaskoz/dailycodingproblem-go (go)

Issue:
Day 252
Good morning! Here's your coding interview problem for today.

This problem was asked by Palantir.

The ancient Egyptians used to express fractions as a sum of several terms where each numerator is one. For example, `4 / 13` can be represented as `1 / 4 + 1 / 18 + 1 / 468`.

Create an algorithm to turn an ordinary fraction a / b, where a < b, into an Egyptian fraction.

Pull request:
Day252
Resolves #519.

Patch:
diff --git a/README.md b/README.md
index dd4989b..ade3bcf 100644
--- a/README.md
+++ b/README.md
@@ -262,3 +262,4 @@ problems from
 * [Day 248](https://github.com/vaskoz/dailycodingproblem-go/issues/512)
 * [Day 249](https://github.com/vaskoz/dailycodingproblem-go/issues/514)
 * [Day 251](https://github.com/vaskoz/dailycodingproblem-go/issues/517)
+* [Day 252](https://github.com/vaskoz/dailycodingproblem-go/issues/519)
diff --git a/day252/problem.go b/day252/problem.go
new file mode 100644
index 0000000..4db1a0e
--- /dev/null
+++ b/day252/problem.go
@@ -0,0 +1,16 @@
+package day252
+
+import "math"
+
+// EgyptianFractions convert a fraction into a list of denominators
+// for an Egyptian fraction.
+func EgyptianFractions(numerator, denominator int) []int {
+	var denominators []int
+	for numerator != 0 {
+		d := int(math.Ceil(float64(denominator) / float64(numerator)))
+		denominators = append(denominators, d)
+		numerator = d*numerator - denominator
+		denominator *= d
+	}
+	return denominators
+}


Test patch:
diff --git a/day252/problem_test.go b/day252/problem_test.go
new file mode 100644
index 0000000..114707d
--- /dev/null
+++ b/day252/problem_test.go
@@ -0,0 +1,31 @@
+package day252
+
+import (
+	"reflect"
+	"testing"
+)
+
+// nolint
+var testcases = []struct {
+	numerator, denominator int
+	denominators           []int
+}{
+	{4, 13, []int{4, 18, 468}},
+}
+
+func TestEgyptianFractions(t *testing.T) {
+	t.Parallel()
+	for _, tc := range testcases {
+		if denoms := EgyptianFractions(tc.numerator, tc.denominator); !reflect.DeepEqual(tc.denominators, denoms) {
+			t.Errorf("Expected %v, got %v", tc.denominators, denoms)
+		}
+	}
+}
+
+func BenchmarkEgyptianFractions(b *testing.B) {
+	for i := 0; i < b.N; i++ {
+		for _, tc := range testcases {
+			EgyptianFractions(tc.numerator, tc.denominator)
+		}
+	}
+}